diff --git a/.travis.yml b/.travis.yml index d9723b8..deed3cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,6 @@ sudo: false php: - 5.6 - - 7.0 - - 7.1 - - 7.2 env: global: @@ -14,35 +11,20 @@ env: - DB_HOST=localhost - DB_NAME=test_prestashop -matrix: - include: - - php: 5.3 - dist: precise - env: BRANCH=1.6.1.x - - php: 5.4 - env: BRANCH=1.6.1.x - - php: 5.5 - env: BRANCH=1.6.1.x - - php: 5.6 - env: BRANCH=1.6.1.x - - php: 7.0 - env: BRANCH=1.6.1.x - - php: 7.1 - env: BRANCH=1.6.1.x - - php: 7.2 - env: BRANCH=1.6.1.x - before_script: - - bash tests/bin/install.sh + - bash tests/bin/clone_prestashop.sh + - cp ../PrestaShop/tests/parameters.yml.travis ../PrestaShop/app/config/parameters.yml + - bash ../PrestaShop/travis-scripts/install-prestashop script: - - phpunit -c phpunit.xml.dist + - bash tests/bin/script.sh + - php ../PrestaShop/vendor/bin/phpunit -c phpunit.xml.dist deploy: skip_cleanup: true provider: script script: make on: - php: 7.2 + php: 5.6 branch: master condition: "$DEPLOY = true" diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index f858715..2275803 100644 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -21,6 +21,16 @@ require_once(dirname(__FILE__) . '/bootstrap.php'); class RetailCRM extends Module { public $api = false; + public $default_lang; + public $default_currency; + public $default_country; + public $apiUrl; + public $apiKey; + public $apiVersion; + public $psVersion; + public $log; + public $confirmUninstall; + public $reference; private $use_new_hooks = true; @@ -570,7 +580,7 @@ class RetailCRM extends Module } else { $paymentCode = $params['order']->payment; } - +var_dump($paymentCode); if ($this->apiVersion != 5) { if (array_key_exists($paymentCode, $payment) && !empty($payment[$paymentCode])) { $order['paymentType'] = $payment[$paymentCode]; diff --git a/tests/bin/clone_prestashop.sh b/tests/bin/clone_prestashop.sh new file mode 100644 index 0000000..4413ab9 --- /dev/null +++ b/tests/bin/clone_prestashop.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if [ -z $TRAVIS_BUILD_DIR ]; then + exit 0; +fi + +PRESTASHOP_DIR=$TRAVIS_BUILD_DIR/../PrestaShop + +cd .. +git clone https://github.com/PrestaShop/PrestaShop +cd PrestaShop + +if ! [ -z $BRANCH ]; then + git checkout $BRANCH; +else + composer install --prefer-dist --no-interaction --no-progress +fi diff --git a/tests/bin/install.sh b/tests/bin/install.sh deleted file mode 100644 index a9c6dfc..0000000 --- a/tests/bin/install.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -if [ -z $TRAVIS_BUILD_DIR ]; then - exit 0; -fi - -PRESTASHOP_DIR=$TRAVIS_BUILD_DIR/../PrestaShop - -create_db() { - mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS" -} - -clone_prestashop() { - cd .. - git clone https://github.com/PrestaShop/PrestaShop - cd PrestaShop - if ! [ -z $BRANCH ]; then - git checkout $BRANCH; - else - composer install; - fi -} - -install_prestashop() { - cd $PRESTASHOP_DIR - - php install-dev/index_cli.php \ - --domain=example.com \ - --db_server=$DB_HOST \ - --db_name=$DB_NAME \ - --db_user=$DB_USER -} - -create_db -clone_prestashop -install_prestashop diff --git a/tests/bin/script.sh b/tests/bin/script.sh new file mode 100644 index 0000000..58c2c7b --- /dev/null +++ b/tests/bin/script.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +if [ -z $TRAVIS_BUILD_DIR ]; then + exit 0; +fi + +PRESTASHOP_DIR=$TRAVIS_BUILD_DIR/../PrestaShop + +cd $PRESTASHOP_DIR +composer run-script create-test-db --timeout=0 diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index 8dcecee..8cf5da5 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -1,11 +1,12 @@ install();