diff --git a/tests/bin/before_script.sh b/tests/bin/before_script.sh index a8c29e4d..1883d53a 100755 --- a/tests/bin/before_script.sh +++ b/tests/bin/before_script.sh @@ -1,19 +1,20 @@ #!/usr/bin/env bash if [ -d $TRAVIS_BUILD_DIR ]; then - BITRIX_PATH="$TRAVIS_BUILD_DIR/bitrix" + BITRIX_PATH="$TRAVIS_BUILD_DIR/bitrix" fi download() { - wget http://download.retailcrm.pro/modules/bitrix/bitrix.tar.gz + wget http://download.retailcrm.pro/modules/bitrix/bitrix.tar.gz - gunzip bitrix.tar.gz - rm bitrix.tar.gz + mkdir bitrix + tar -xf bitrix.tar.gz -C bitrix + rm bitrix.tar.gz } create_db() { - mysqladmin create $DB_BITRIX_NAME --user="$DB_BITRIX_LOGIN" --password="$DB_BITRIX_PASS" - mysql -user="$DB_BITRIX_LOGIN" -password="$DB_BITRIX_PASS" $DB_BITRIX_NAME < $BITRIX_PATH/dump.sql + mysqladmin create $DB_BITRIX_NAME --user="$DB_BITRIX_LOGIN" --password="$DB_BITRIX_PASS" + mysql -user="$DB_BITRIX_LOGIN" -password="$DB_BITRIX_PASS" $DB_BITRIX_NAME < $BITRIX_PATH/dump.sql } download diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index f84e3518..31762562 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -12,11 +12,11 @@ $dotenv = Dotenv\Dotenv::create(__DIR__ . '/../../'); $dotenv->load(); -//if (getenv('TRAVIS_BUILD_DIR')) { -// $_SERVER['DOCUMENT_ROOT'] = getenv('TRAVIS_BUILD_DIR') . '/bitrix'; -//} else { +if (getenv('TRAVIS_BUILD_DIR')) { + $_SERVER['DOCUMENT_ROOT'] = getenv('TRAVIS_BUILD_DIR') . '/bitrix'; +} else { $_SERVER['DOCUMENT_ROOT'] = getenv('BITRIX_PATH'); -//} +} define('NOT_CHECK_PERMISSIONS', true); define('NO_AGENT_CHECK', true);