mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
parent
c531f9b124
commit
31aafde3e5
@ -2,10 +2,9 @@ FROM php:7.2-fpm
|
|||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -y zlib1g-dev libpq-dev git libicu-dev libxml2-dev libpng-dev libjpeg-dev libmcrypt-dev libxslt-dev libfreetype6-dev unzip\
|
RUN apt-get install -y zlib1g-dev libpq-dev git libicu-dev libxml2-dev libpng-dev libjpeg-dev libmcrypt-dev libxslt-dev libfreetype6-dev unzip nano\
|
||||||
&& docker-php-ext-configure intl \
|
&& docker-php-ext-configure intl \
|
||||||
&& docker-php-ext-install intl \
|
&& docker-php-ext-install intl \
|
||||||
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
|
|
||||||
&& docker-php-ext-install mysqli pdo pdo_mysql \
|
&& docker-php-ext-install mysqli pdo pdo_mysql \
|
||||||
&& docker-php-ext-install zip \
|
&& docker-php-ext-install zip \
|
||||||
&& docker-php-ext-install xml \
|
&& docker-php-ext-install xml \
|
||||||
@ -18,14 +17,7 @@ RUN apt-get install -y zlib1g-dev libpq-dev git libicu-dev libxml2-dev libpng-de
|
|||||||
&& pecl install mcrypt-1.0.1 \
|
&& pecl install mcrypt-1.0.1 \
|
||||||
&& docker-php-ext-enable mcrypt
|
&& docker-php-ext-enable mcrypt
|
||||||
|
|
||||||
RUN apt-get install -y wget
|
RUN curl -sSL https://phar.phpunit.de/phpunit-6.phar -o /usr/bin/phpunit && chmod +x /usr/bin/phpunit \
|
||||||
|
&& curl -sSL https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer
|
||||||
RUN wget -O /usr/bin/phpunit https://phar.phpunit.de/phpunit-6.phar && chmod +x /usr/bin/phpunit
|
|
||||||
RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer && chmod +x /usr/bin/composer
|
|
||||||
|
|
||||||
# Set timezone
|
|
||||||
RUN rm /etc/localtime
|
|
||||||
RUN ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
|
|
||||||
RUN "date"
|
|
||||||
|
|
||||||
WORKDIR /code
|
WORKDIR /code
|
22
.github/workflows/presta.yml
vendored
22
.github/workflows/presta.yml
vendored
@ -17,21 +17,19 @@ jobs:
|
|||||||
- php-version: '7.1'
|
- php-version: '7.1'
|
||||||
branch: '1.7.7.0'
|
branch: '1.7.7.0'
|
||||||
composerv1: 1
|
composerv1: 1
|
||||||
phpunit-version: 'phpunit:6.4.3'
|
|
||||||
- php-version: '7.2'
|
- php-version: '7.2'
|
||||||
branch: '1.7.7.0'
|
branch: '1.7.7.0'
|
||||||
composerv1: 1
|
composerv1: 1
|
||||||
phpunit-version: 'phpunit:6.4.3'
|
- php-version: '7.3'
|
||||||
|
branch: '1.7.7.0'
|
||||||
|
composerv1: 1
|
||||||
- php-version: '7.1'
|
- php-version: '7.1'
|
||||||
branch: '1.7.7.8'
|
branch: '1.7.8.10'
|
||||||
composerv1: 1
|
|
||||||
phpunit-version: 'phpunit:6.4.3'
|
|
||||||
- php-version: '7.2'
|
|
||||||
branch: '1.7.7.8'
|
|
||||||
composerv1: 1
|
|
||||||
coverage: 1
|
coverage: 1
|
||||||
phpunit-version: 'phpunit:6.4.3'
|
- php-version: '7.2'
|
||||||
|
branch: '1.7.8.10'
|
||||||
|
- php-version: '7.3'
|
||||||
|
branch: '1.7.8.10'
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
@ -47,7 +45,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
coverage: xdebug
|
coverage: xdebug
|
||||||
tools: composer:v2, ${{ matrix.phpunit-version }}
|
tools: composer:v2, phpunit:6.4.3
|
||||||
extensions: gd, mbstring, zip, mcrypt, pdo_mysql, dom
|
extensions: gd, mbstring, zip, mcrypt, pdo_mysql, dom
|
||||||
- name: Start mysql service
|
- name: Start mysql service
|
||||||
run: sudo /etc/init.d/mysql start
|
run: sudo /etc/init.d/mysql start
|
||||||
@ -60,7 +58,7 @@ jobs:
|
|||||||
BRANCH: ${{ matrix.branch }}
|
BRANCH: ${{ matrix.branch }}
|
||||||
COMPOSERV1: ${{ matrix.composerv1 }}
|
COMPOSERV1: ${{ matrix.composerv1 }}
|
||||||
MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
|
MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
run: make before_script
|
run: make install_prestashop
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
env:
|
env:
|
||||||
BRANCH: ${{ matrix.branch }}
|
BRANCH: ${{ matrix.branch }}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
## v3.6.1
|
||||||
|
* Добавлены тесты для новых версий PrestaShop
|
||||||
|
|
||||||
## v3.6.0
|
## v3.6.0
|
||||||
* Добавлена поддержка PrestaShop 1.7.8.10
|
* Добавлена поддержка PrestaShop 1.7.8.10
|
||||||
|
|
||||||
|
66
Makefile
66
Makefile
@ -14,62 +14,34 @@ delete_archive:
|
|||||||
rm -f $(ARCHIVE_NAME)
|
rm -f $(ARCHIVE_NAME)
|
||||||
rm -f /tmp/retailcrm.zip
|
rm -f /tmp/retailcrm.zip
|
||||||
|
|
||||||
composer: clone_prestashop clone_composer fix-version-lang-bugs
|
|
||||||
ifeq ($(COMPOSERV1),1)
|
|
||||||
cd $(PRESTASHOP_DIR) && php composer.phar install --prefer-dist --no-interaction --no-progress
|
|
||||||
else
|
|
||||||
cd $(PRESTASHOP_DIR)/tests && composer install
|
|
||||||
endif
|
|
||||||
|
|
||||||
clone_prestashop:
|
clone_prestashop:
|
||||||
cd $(ROOT_DIR)/../ && git clone https://github.com/PrestaShop/PrestaShop
|
cd $(ROOT_DIR)/../ && git clone https://github.com/PrestaShop/PrestaShop
|
||||||
cd $(PRESTASHOP_DIR) && git checkout $(BRANCH)
|
cd $(PRESTASHOP_DIR) && git checkout $(BRANCH)
|
||||||
|
|
||||||
clone_composer:
|
# Required for versions 1.7.7.x - 1.7.8.x
|
||||||
ifeq ($(COMPOSERV1),1)
|
# Only this command work in Makefile for replace $sfContainer->get('translator')
|
||||||
cd $(PRESTASHOP_DIR) \
|
# sed -i 's/$$sfContainer->get('"'"'translator'"'"')/Context::getContext()->getTranslator()/g' classes/Language.php
|
||||||
&& php -r "copy('https://getcomposer.org/download/1.10.17/composer.phar', 'composer.phar');"
|
fix_lang_bugs:
|
||||||
endif
|
cd $(PRESTASHOP_DIR) && sed -i \
|
||||||
|
-e "s/throw new Exception/#throw new Exception/g" \
|
||||||
|
-e "s/SymfonyContainer::getInstance()->get('translator')/Context::getContext()->getTranslator()/g" \
|
||||||
|
-e 's/$$sfContainer->get('"'"'translator'"'"')/Context::getContext()->getTranslator()/g' \
|
||||||
|
src/PrestaShopBundle/Install/DatabaseDump.php classes/lang/DataLang.php classes/Language.php
|
||||||
|
|
||||||
before_script: composer
|
install_composer:
|
||||||
ifneq ("$(wildcard $(PRESTASHOP_DIR)/travis-scripts/install-prestashop)","")
|
# Required for versions 1.7.7.x
|
||||||
ifeq ($(COMPOSERV1),1)
|
ifeq ($(COMPOSERV1),1)
|
||||||
cd $(PRESTASHOP_DIR) \
|
composer self-update --1
|
||||||
&& sed -i 's/mysql -u root/mysql -u root --port $(MYSQL_PORT)/g' travis-scripts/install-prestashop \
|
|
||||||
&& sed -i 's/--db_server=127.0.0.1 --db_name=prestashop/--db_server=127.0.0.1:$(MYSQL_PORT) --db_name=prestashop --db_user=root/g' travis-scripts/install-prestashop \
|
|
||||||
&& bash travis-scripts/install-prestashop
|
|
||||||
else
|
|
||||||
cd $(PRESTASHOP_DIR) \
|
|
||||||
&& sed -i 's/mysql -u root/mysql -u root -proot --port $(MYSQL_PORT)/g' travis-scripts/install-prestashop.sh \
|
|
||||||
&& sed -i 's/--db_server=127.0.0.1 --db_name=prestashop/--db_server=127.0.0.1:$(MYSQL_PORT) --db_name=prestashop --db_user=root/g' travis-scripts/install-prestashop.sh \
|
|
||||||
&& bash travis-scripts/install-prestashop.sh
|
|
||||||
endif
|
endif
|
||||||
else
|
cd $(PRESTASHOP_DIR) && composer install
|
||||||
rm -rf var/cache/*
|
|
||||||
echo "* Installing PrestaShop, this may take a while ...";
|
|
||||||
|
|
||||||
|
install_prestashop: clone_prestashop fix_lang_bugs install_composer
|
||||||
ifeq ($(LOCAL_TEST),1)
|
ifeq ($(LOCAL_TEST),1)
|
||||||
cd $(PRESTASHOP_DIR) && php install-dev/index_cli.php --db_server=db --db_user=root --db_create=1
|
cd $(PRESTASHOP_DIR) && php install-dev/index_cli.php --db_server=db --db_user=root --db_create=1
|
||||||
else
|
else
|
||||||
mkdir coverage
|
|
||||||
cd $(PRESTASHOP_DIR) && php install-dev/index_cli.php --db_server=127.0.0.1:$(MYSQL_PORT) --db_user=root --db_create=1
|
cd $(PRESTASHOP_DIR) && php install-dev/index_cli.php --db_server=127.0.0.1:$(MYSQL_PORT) --db_user=root --db_create=1
|
||||||
|
mkdir coverage
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
# Required for versions 1.7.7.x
|
|
||||||
fix-version-lang-bugs:
|
|
||||||
ifeq ($(COMPOSERV1),1)
|
|
||||||
cd $(PRESTASHOP_DIR) \
|
|
||||||
&& sed -i 's/throw new Exception/#throw new Exception/g' src/PrestaShopBundle/Install/DatabaseDump.php
|
|
||||||
endif
|
|
||||||
|
|
||||||
cd $(PRESTASHOP_DIR) \
|
|
||||||
&& sed -i "s/SymfonyContainer::getInstance()->get('translator')/\\\\Context::getContext()->getTranslator()/g" classes/lang/DataLang.php
|
|
||||||
cat $(PRESTASHOP_DIR)/classes/lang/DataLang.php | grep -A 3 -B 3 'this->translator = '
|
|
||||||
|
|
||||||
cd $(PRESTASHOP_DIR) \
|
|
||||||
&& sed -i "s/SymfonyContainer::getInstance()->get('translator')/\\\\Context::getContext()->getTranslator()/g" classes/Language.php
|
|
||||||
cat $(PRESTASHOP_DIR)/classes/Language.php | grep -A 3 -B 3 'translator = '
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
php-cs-fixer fix --config=$(ROOT_DIR)/.php-cs-fixer.php -v
|
php-cs-fixer fix --config=$(ROOT_DIR)/.php-cs-fixer.php -v
|
||||||
@ -77,11 +49,11 @@ lint:
|
|||||||
lint-docker:
|
lint-docker:
|
||||||
docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:latest --config=.php-cs-fixer.php -v
|
docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:latest --config=.php-cs-fixer.php -v
|
||||||
|
|
||||||
# todo moveto version
|
|
||||||
test:
|
test:
|
||||||
|
cd $(PRESTASHOP_DIR) && composer run-script create-test-db --timeout=0
|
||||||
|
|
||||||
ifeq ($(COMPOSERV1),1)
|
ifeq ($(COMPOSERV1),1)
|
||||||
cd $(PRESTASHOP_DIR) && php composer.phar run-script create-test-db --timeout=0
|
phpunit -c $(ROOT_DIR)/phpunit.xml.dist
|
||||||
cd $(PRESTASHOP_DIR) && php vendor/bin/phpunit -c $(ROOT_DIR)/phpunit.xml.dist
|
|
||||||
else
|
else
|
||||||
phpunit -c phpunit.xml.dist
|
phpunit -c phpunit.xml.dist
|
||||||
endif
|
endif
|
||||||
@ -91,5 +63,5 @@ coverage:
|
|||||||
|
|
||||||
run_local_tests:
|
run_local_tests:
|
||||||
docker-compose up -d --build
|
docker-compose up -d --build
|
||||||
docker exec app_test make before_script test
|
docker exec app_prestashop_test make install_prestashop test
|
||||||
docker-compose down
|
docker-compose down
|
||||||
|
@ -1,22 +1,19 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
container_name: app_test
|
container_name: app_prestashop_test
|
||||||
build:
|
build:
|
||||||
context: ./.docker
|
context: ./.docker
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/code
|
- ./:/code
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
environment:
|
|
||||||
- BRANCH=${BRANCH}
|
|
||||||
links:
|
|
||||||
- db
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
db:
|
db:
|
||||||
|
container_name: mysql_prestashop_test
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- '3306:3306'
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
<exclude>tests/helpers</exclude>
|
<exclude>tests/helpers</exclude>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
<php>
|
||||||
|
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
|
||||||
|
</php>
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist>
|
<whitelist>
|
||||||
<directory suffix=".php">retailcrm</directory>
|
<directory suffix=".php">retailcrm</directory>
|
||||||
|
@ -48,7 +48,7 @@ require_once dirname(__FILE__) . '/bootstrap.php';
|
|||||||
|
|
||||||
class RetailCRM extends Module
|
class RetailCRM extends Module
|
||||||
{
|
{
|
||||||
const VERSION = '3.6.0';
|
const VERSION = '3.6.1';
|
||||||
|
|
||||||
const API_URL = 'RETAILCRM_ADDRESS';
|
const API_URL = 'RETAILCRM_ADDRESS';
|
||||||
const API_KEY = 'RETAILCRM_API_TOKEN';
|
const API_KEY = 'RETAILCRM_API_TOKEN';
|
||||||
|
@ -496,6 +496,8 @@ class RetailcrmHistoryTest extends RetailcrmTestCase
|
|||||||
RetailcrmHistory::$api = $this->apiMock;
|
RetailcrmHistory::$api = $this->apiMock;
|
||||||
|
|
||||||
RetailcrmHistory::ordersHistory();
|
RetailcrmHistory::ordersHistory();
|
||||||
|
|
||||||
|
$this->assertTrue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testOrderAddressUpdate()
|
public function testOrderAddressUpdate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user