mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-03 11:43:16 +03:00
Update .travis.yml and bash scripts
This commit is contained in:
parent
8f99d55144
commit
d1db728a7b
30
.travis.yml
30
.travis.yml
@ -4,9 +4,6 @@ sudo: false
|
|||||||
|
|
||||||
php:
|
php:
|
||||||
- 5.6
|
- 5.6
|
||||||
- 7.0
|
|
||||||
- 7.1
|
|
||||||
- 7.2
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
@ -14,35 +11,20 @@ env:
|
|||||||
- DB_HOST=localhost
|
- DB_HOST=localhost
|
||||||
- DB_NAME=test_prestashop
|
- 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:
|
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:
|
script:
|
||||||
- phpunit -c phpunit.xml.dist
|
- bash tests/bin/script.sh
|
||||||
|
- php ../PrestaShop/vendor/bin/phpunit -c phpunit.xml.dist
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
provider: script
|
provider: script
|
||||||
script: make
|
script: make
|
||||||
on:
|
on:
|
||||||
php: 7.2
|
php: 5.6
|
||||||
branch: master
|
branch: master
|
||||||
condition: "$DEPLOY = true"
|
condition: "$DEPLOY = true"
|
||||||
|
@ -21,6 +21,16 @@ require_once(dirname(__FILE__) . '/bootstrap.php');
|
|||||||
class RetailCRM extends Module
|
class RetailCRM extends Module
|
||||||
{
|
{
|
||||||
public $api = false;
|
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;
|
private $use_new_hooks = true;
|
||||||
|
|
||||||
@ -570,7 +580,7 @@ class RetailCRM extends Module
|
|||||||
} else {
|
} else {
|
||||||
$paymentCode = $params['order']->payment;
|
$paymentCode = $params['order']->payment;
|
||||||
}
|
}
|
||||||
|
var_dump($paymentCode);
|
||||||
if ($this->apiVersion != 5) {
|
if ($this->apiVersion != 5) {
|
||||||
if (array_key_exists($paymentCode, $payment) && !empty($payment[$paymentCode])) {
|
if (array_key_exists($paymentCode, $payment) && !empty($payment[$paymentCode])) {
|
||||||
$order['paymentType'] = $payment[$paymentCode];
|
$order['paymentType'] = $payment[$paymentCode];
|
||||||
|
17
tests/bin/clone_prestashop.sh
Normal file
17
tests/bin/clone_prestashop.sh
Normal file
@ -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
|
@ -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
|
|
10
tests/bin/script.sh
Normal file
10
tests/bin/script.sh
Normal file
@ -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
|
@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once dirname(__DIR__) . '../../../PrestaShop/tests/bootstrap.php';
|
require_once __DIR__ . '/../../../PrestaShop/tests/bootstrap.php';
|
||||||
require_once dirname(__DIR__) . '../../../PrestaShop/config/config.inc.php';
|
require_once dirname(__DIR__) . '../../../PrestaShop/config/config.inc.php';
|
||||||
require_once dirname(__DIR__) . '../../../PrestaShop/config/defines_uri.inc.php';
|
require_once dirname(__DIR__) . '../../../PrestaShop/config/defines_uri.inc.php';
|
||||||
require_once dirname(__DIR__) . '../../retailcrm/bootstrap.php';
|
require_once dirname(__DIR__) . '../../retailcrm/bootstrap.php';
|
||||||
require_once dirname(__DIR__) . '/helpers/RetailcrmTestCase.php';
|
require_once __DIR__ . '/../../retailcrm/retailcrm.php';
|
||||||
require_once dirname(__DIR__) . '/helpers/RetailcrmTestHelper.php';
|
require_once __DIR__ . '/../helpers/RetailcrmTestCase.php';
|
||||||
|
require_once __DIR__ . '/../helpers/RetailcrmTestHelper.php';
|
||||||
|
|
||||||
$module = new RetailCRM();
|
$module = new RetailCRM();
|
||||||
$module->install();
|
$module->install();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user