Przeglądaj źródła

Adjusted test configs structure

Alexander Makarov 11 lat temu
rodzic
commit
229c352f78

+ 10 - 10
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

+ 1 - 2
tests/codeception/acceptance/_bootstrap.php

@@ -1,3 +1,2 @@
 <?php
-
-new yii\web\Application(require(__DIR__ . '/_config.php'));
+new yii\web\Application(require(dirname(__DIR__) . '/config/acceptance.php'));

+ 0 - 2
tests/codeception/bin/_console_bootstrap.php

@@ -1,7 +1,5 @@
 <?php
-
 defined('YII_DEBUG') or define('YII_DEBUG', true);
-
 defined('YII_ENV') or define('YII_ENV', 'test');
 
 // fcgi doesn't have STDIN and STDOUT defined by default

+ 2 - 2
tests/codeception/bin/yii_acceptance

@@ -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' => [

+ 2 - 2
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' => [

+ 2 - 2
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' => [

+ 4 - 2
tests/codeception/acceptance/_config.php

@@ -1,8 +1,10 @@
 <?php
-
+/**
+ * Application configuration for acceptance tests
+ */
 return yii\helpers\ArrayHelper::merge(
     require(__DIR__ . '/../../../config/web.php'),
-    require(__DIR__ . '/../_config.php'),
+    require(__DIR__ . '/config.php'),
     [
         'components' => [
             'db' => [

+ 1 - 1
tests/codeception/_config.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * application configurations shared by all test types
+ * Application configuration shared by all test types
  */
 return [
     'components' => [

+ 4 - 1
tests/codeception/functional/_config.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' => [

+ 4 - 2
tests/codeception/unit/_config.php

@@ -1,8 +1,10 @@
 <?php
-
+/**
+ * Application configuration for unit tests
+ */
 return yii\helpers\ArrayHelper::merge(
     require(__DIR__ . '/../../../config/web.php'),
-    require(__DIR__ . '/../_config.php'),
+    require(__DIR__ . '/config.php'),
     [
         'components' => [
             'db' => [

+ 1 - 1
tests/codeception/functional.suite.yml

@@ -13,4 +13,4 @@ modules:
       - Yii2
     config:
         Yii2:
-            configFile: 'codeception/functional/_config.php'
+            configFile: 'codeception/config/functional.php'

+ 1 - 2
tests/codeception/functional/_bootstrap.php

@@ -1,3 +1,2 @@
 <?php
-
-new yii\web\Application(require(__DIR__ . '/_config.php'));
+new yii\web\Application(require(dirname(__DIR__) . '/config/functional.php'));

+ 1 - 1
web/index-test.php

@@ -11,6 +11,6 @@ defined('YII_ENV') or define('YII_ENV', 'test');
 require(__DIR__ . '/../vendor/autoload.php');
 require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
 
-$config = require(__DIR__ . '/../tests/codeception/acceptance/_config.php');
+$config = require(__DIR__ . '/../tests/codeception/config/acceptance.php');
 
 (new yii\web\Application($config))->run();