From 229c352f78f53e49c4de08252b6f0f1ffcce4e75 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sun, 17 Aug 2014 18:45:58 +0400 Subject: [PATCH] Adjusted test configs structure --- tests/codeception/acceptance/ContactCept.php | 20 +++++++++---------- tests/codeception/acceptance/_bootstrap.php | 3 +-- ...{_console_bootstrap.php => _bootstrap.php} | 2 -- tests/codeception/bin/yii_acceptance | 4 ++-- tests/codeception/bin/yii_functional | 4 ++-- tests/codeception/bin/yii_unit | 4 ++-- .../_config.php => config/acceptance.php} | 6 ++++-- .../{_config.php => config/config.php} | 2 +- .../_config.php => config/functional.php} | 5 ++++- .../{unit/_config.php => config/unit.php} | 6 ++++-- tests/codeception/functional.suite.yml | 2 +- tests/codeception/functional/_bootstrap.php | 3 +-- web/index-test.php | 2 +- 13 files changed, 33 insertions(+), 30 deletions(-) rename tests/codeception/bin/{_console_bootstrap.php => _bootstrap.php} (99%) rename tests/codeception/{acceptance/_config.php => config/acceptance.php} (73%) rename tests/codeception/{_config.php => config/config.php} (78%) rename tests/codeception/{functional/_config.php => config/functional.php} (78%) rename tests/codeception/{unit/_config.php => config/unit.php} (74%) diff --git a/tests/codeception/acceptance/ContactCept.php b/tests/codeception/acceptance/ContactCept.php index 27858f8..c9adc7e 100644 --- a/tests/codeception/acceptance/ContactCept.php +++ b/tests/codeception/acceptance/ContactCept.php @@ -21,11 +21,11 @@ $I->see('The verification code is incorrect'); $I->amGoingTo('submit contact form with not correct email'); $contactPage->submit([ - 'name' => 'tester', - 'email' => 'tester.email', - 'subject' => 'test subject', - 'body' => 'test content', - 'verifyCode' => 'testme', + 'name' => 'tester', + 'email' => 'tester.email', + 'subject' => 'test subject', + 'body' => 'test content', + 'verifyCode' => 'testme', ]); $I->expectTo('see that email adress is wrong'); $I->dontSee('Name cannot be blank', '.help-inline'); @@ -36,11 +36,11 @@ $I->dontSee('The verification code is incorrect', '.help-inline'); $I->amGoingTo('submit contact form with correct data'); $contactPage->submit([ - 'name' => 'tester', - 'email' => 'tester@example.com', - 'subject' => 'test subject', - 'body' => 'test content', - 'verifyCode' => 'testme', + 'name' => 'tester', + 'email' => 'tester@example.com', + 'subject' => 'test subject', + 'body' => 'test content', + 'verifyCode' => 'testme', ]); if (method_exists($I, 'wait')) { $I->wait(3); // only for selenium diff --git a/tests/codeception/acceptance/_bootstrap.php b/tests/codeception/acceptance/_bootstrap.php index 6ce3d17..36f9f1d 100644 --- a/tests/codeception/acceptance/_bootstrap.php +++ b/tests/codeception/acceptance/_bootstrap.php @@ -1,3 +1,2 @@ [ 'db' => [ diff --git a/tests/codeception/bin/yii_functional b/tests/codeception/bin/yii_functional index 44051e2..148420f 100644 --- a/tests/codeception/bin/yii_functional +++ b/tests/codeception/bin/yii_functional @@ -8,11 +8,11 @@ * @license http://www.yiiframework.com/license/ */ -require_once __DIR__ . '/_console_bootstrap.php'; +require_once __DIR__ . '/_bootstrap.php'; $config = yii\helpers\ArrayHelper::merge( require(ROOT_DIR . '/config/console.php'), - require(__DIR__ . '/../_config.php'), + require(__DIR__ . '/../config/config.php'), [ 'components' => [ 'db' => [ diff --git a/tests/codeception/bin/yii_unit b/tests/codeception/bin/yii_unit index e9b7999..5fb938e 100644 --- a/tests/codeception/bin/yii_unit +++ b/tests/codeception/bin/yii_unit @@ -8,11 +8,11 @@ * @license http://www.yiiframework.com/license/ */ -require_once __DIR__ . '/_console_bootstrap.php'; +require_once __DIR__ . '/_bootstrap.php'; $config = yii\helpers\ArrayHelper::merge( require(ROOT_DIR . '/config/console.php'), - require(__DIR__ . '/../_config.php'), + require(__DIR__ . '/../config/config.php'), [ 'components' => [ 'db' => [ diff --git a/tests/codeception/acceptance/_config.php b/tests/codeception/config/acceptance.php similarity index 73% rename from tests/codeception/acceptance/_config.php rename to tests/codeception/config/acceptance.php index d620a7d..c80d468 100644 --- a/tests/codeception/acceptance/_config.php +++ b/tests/codeception/config/acceptance.php @@ -1,8 +1,10 @@ [ 'db' => [ diff --git a/tests/codeception/_config.php b/tests/codeception/config/config.php similarity index 78% rename from tests/codeception/_config.php rename to tests/codeception/config/config.php index 8629dd0..005d365 100644 --- a/tests/codeception/_config.php +++ b/tests/codeception/config/config.php @@ -1,6 +1,6 @@ [ diff --git a/tests/codeception/functional/_config.php b/tests/codeception/config/functional.php similarity index 78% rename from tests/codeception/functional/_config.php rename to tests/codeception/config/functional.php index 515c904..13cfc64 100644 --- a/tests/codeception/functional/_config.php +++ b/tests/codeception/config/functional.php @@ -2,9 +2,12 @@ $_SERVER['SCRIPT_FILENAME'] = TEST_ENTRY_FILE; $_SERVER['SCRIPT_NAME'] = TEST_ENTRY_URL; +/** + * Application configuration for functional tests + */ return yii\helpers\ArrayHelper::merge( require(__DIR__ . '/../../../config/web.php'), - require(__DIR__ . '/../_config.php'), + require(__DIR__ . '/config.php'), [ 'components' => [ 'db' => [ diff --git a/tests/codeception/unit/_config.php b/tests/codeception/config/unit.php similarity index 74% rename from tests/codeception/unit/_config.php rename to tests/codeception/config/unit.php index 36b0114..1b8772d 100644 --- a/tests/codeception/unit/_config.php +++ b/tests/codeception/config/unit.php @@ -1,8 +1,10 @@ [ 'db' => [ diff --git a/tests/codeception/functional.suite.yml b/tests/codeception/functional.suite.yml index 94ff0c9..ad7164c 100644 --- a/tests/codeception/functional.suite.yml +++ b/tests/codeception/functional.suite.yml @@ -13,4 +13,4 @@ modules: - Yii2 config: Yii2: - configFile: 'codeception/functional/_config.php' + configFile: 'codeception/config/functional.php' diff --git a/tests/codeception/functional/_bootstrap.php b/tests/codeception/functional/_bootstrap.php index 6ce3d17..8aac091 100644 --- a/tests/codeception/functional/_bootstrap.php +++ b/tests/codeception/functional/_bootstrap.php @@ -1,3 +1,2 @@ run();