Skip to content

Commit f28bf06

Browse files
committed
update test env
1 parent 687e0b5 commit f28bf06

23 files changed

+223
-243
lines changed

.travis.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,38 @@ php:
33
- 5.4
44
- 5.5
55
- 5.6
6-
6+
7+
# faster builds on new travis setup not using sudo
8+
sudo: false
9+
10+
# cache vendor dirs
11+
cache:
12+
directories:
13+
- $HOME/.composer/cache
14+
715
install:
8-
- composer self-update && composer --version
9-
- composer global require "fxp/composer-asset-plugin:1.0.*@dev"
10-
- export PATH="$HOME/.composer/vendor/bin:$PATH"
11-
- composer install --prefer-dist
16+
- travis_retry composer self-update && composer --version
17+
- travis_retry composer global require "fxp/composer-asset-plugin:~1.0.0"
18+
- export PATH="$HOME/.composer/vendor/bin:$PATH"
19+
- travis_retry composer install --dev --prefer-dist --no-interaction
20+
# codeception
21+
- travis_retry composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*"
22+
# setup application:
23+
- |
24+
./init --env=Development
25+
sed -i s/root/travis/ common/config/main-local.php
26+
sed -i "s/'cookieValidationKey' => ''/'cookieValidationKey' => 'testkey'/" backend/config/main.php
27+
cd tests/codeception/backend && codecept build
28+
cd ../common && codecept build
29+
cd ../console && codecept build
30+
cd ../rest && codecept build
31+
cd ../../../
32+
33+
before_script:
34+
- cd tests/codeception/bin && php yii migrate --interactive=0 && cd ../../..
1235

1336
script:
14-
- echo "Skipping tests"
37+
- |
38+
php -S localhost:8080 > /dev/null 2>&1 &
39+
cd tests
40+
codecept run

tests/codeception.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
include:
22
- codeception/common
33
- codeception/console
4-
- codeception/backend
5-
- codeception/frontend
4+
- codeception/rest
65

76
paths:
87
log: codeception/_output

tests/codeception/backend/acceptance/LoginCept.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/codeception/backend/functional/LoginCept.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/codeception/config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
return [
66
'components' => [
77
'db' => [
8-
'dsn' => 'mysql:host=localhost;dbname=yii2_advanced_tests',
8+
'dsn' => 'sqlite:' . __DIR__ .'/../../../sqlite-test.db',
99
],
1010
'mailer' => [
1111
'useFileTransport' => true,
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<?php
2-
defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', dirname(dirname(dirname(dirname(__DIR__)))));
3-
4-
/**
5-
* Application configuration for backend acceptance tests
6-
*/
7-
return yii\helpers\ArrayHelper::merge(
8-
require(YII_APP_BASE_PATH . '/common/config/main.php'),
9-
require(YII_APP_BASE_PATH . '/common/config/main-local.php'),
10-
require(YII_APP_BASE_PATH . '/backend/config/main.php'),
11-
require(YII_APP_BASE_PATH . '/backend/config/main-local.php'),
12-
require(dirname(__DIR__) . '/config.php'),
13-
require(dirname(__DIR__) . '/acceptance.php'),
14-
require(__DIR__ . '/config.php'),
15-
[
16-
]
17-
);
1+
<?php
2+
defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', dirname(dirname(dirname(dirname(__DIR__)))));
3+
4+
/**
5+
* Application configuration for backend acceptance tests
6+
*/
7+
return yii\helpers\ArrayHelper::merge(
8+
require(YII_APP_BASE_PATH . '/common/config/main.php'),
9+
require(YII_APP_BASE_PATH . '/common/config/main-local.php'),
10+
require(YII_APP_BASE_PATH . '/rest/config/main.php'),
11+
require(YII_APP_BASE_PATH . '/rest/config/main-local.php'),
12+
require(dirname(__DIR__) . '/config.php'),
13+
require(dirname(__DIR__) . '/acceptance.php'),
14+
require(__DIR__ . '/config.php'),
15+
[
16+
]
17+
);
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
<?php
2-
/**
3-
* Application configuration for all backend test types
4-
*/
5-
return [];
1+
<?php
2+
/**
3+
* Application configuration for all backend test types
4+
*/
5+
return [
6+
'components' => [
7+
8+
],
9+
];
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<?php
2-
$_SERVER['SCRIPT_FILENAME'] = YII_TEST_BACKEND_ENTRY_FILE;
3-
$_SERVER['SCRIPT_NAME'] = YII_BACKEND_TEST_ENTRY_URL;
4-
5-
/**
6-
* Application configuration for backend functional tests
7-
*/
8-
return yii\helpers\ArrayHelper::merge(
9-
require(YII_APP_BASE_PATH . '/backend/config/main.php'),
10-
require(YII_APP_BASE_PATH . '/backend/config/main-local.php'),
11-
require(YII_APP_BASE_PATH . '/common/config/main.php'),
12-
require(YII_APP_BASE_PATH . '/common/config/main-local.php'),
13-
require(dirname(__DIR__) . '/config.php'),
14-
require(dirname(__DIR__) . '/functional.php'),
15-
require(__DIR__ . '/config.php'),
16-
[
17-
]
18-
);
1+
<?php
2+
$_SERVER['SCRIPT_FILENAME'] = YII_TEST_REST_ENTRY_FILE;
3+
$_SERVER['SCRIPT_NAME'] = YII_REST_TEST_ENTRY_URL;
4+
5+
/**
6+
* Application configuration for rest functional tests
7+
*/
8+
return yii\helpers\ArrayHelper::merge(
9+
require(YII_APP_BASE_PATH . '/rest/config/main.php'),
10+
require(YII_APP_BASE_PATH . '/rest/config/main-local.php'),
11+
require(YII_APP_BASE_PATH . '/common/config/main.php'),
12+
require(YII_APP_BASE_PATH . '/common/config/main-local.php'),
13+
require(dirname(__DIR__) . '/config.php'),
14+
require(dirname(__DIR__) . '/functional.php'),
15+
require(__DIR__ . '/config.php'),
16+
[
17+
]
18+
);
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<?php
2-
3-
/**
4-
* Application configuration for backend unit tests
5-
*/
6-
return yii\helpers\ArrayHelper::merge(
7-
require(YII_APP_BASE_PATH . '/common/config/main.php'),
8-
require(YII_APP_BASE_PATH . '/common/config/main-local.php'),
9-
require(YII_APP_BASE_PATH . '/backend/config/main.php'),
10-
require(YII_APP_BASE_PATH . '/backend/config/main-local.php'),
11-
require(dirname(__DIR__) . '/config.php'),
12-
require(dirname(__DIR__) . '/unit.php'),
13-
require(__DIR__ . '/config.php'),
14-
[
15-
]
16-
);
1+
<?php
2+
3+
/**
4+
* Application configuration for backend unit tests
5+
*/
6+
return yii\helpers\ArrayHelper::merge(
7+
require(YII_APP_BASE_PATH . '/common/config/main.php'),
8+
require(YII_APP_BASE_PATH . '/common/config/main-local.php'),
9+
require(YII_APP_BASE_PATH . '/rest/config/main.php'),
10+
require(YII_APP_BASE_PATH . '/rest/config/main-local.php'),
11+
require(dirname(__DIR__) . '/config.php'),
12+
require(dirname(__DIR__) . '/unit.php'),
13+
require(__DIR__ . '/config.php'),
14+
[
15+
]
16+
);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# these files are auto generated by codeception build
2-
/unit/UnitTester.php
3-
/functional/FunctionalTester.php
4-
/acceptance/AcceptanceTester.php
1+
# these files are auto generated by codeception build
2+
/unit/UnitTester.php
3+
/functional/FunctionalTester.php
4+
/acceptance/AcceptanceTester.php

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy