From 872ade6f5e2b2118b4bd497450665a0346e36179 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 29 Dec 2013 16:25:22 -0500 Subject: [PATCH] fixed unit test config. --- apps/basic/tests/unit.suite.dist.yml | 9 --------- apps/basic/tests/unit.suite.yml | 9 +++++++++ apps/basic/tests/unit/_bootstrap.php | 5 +---- apps/basic/tests/unit/_config.php | 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 13 deletions(-) delete mode 100644 apps/basic/tests/unit.suite.dist.yml create mode 100644 apps/basic/tests/unit.suite.yml create mode 100644 apps/basic/tests/unit/_config.php diff --git a/apps/basic/tests/unit.suite.dist.yml b/apps/basic/tests/unit.suite.dist.yml deleted file mode 100644 index be2874d..0000000 --- a/apps/basic/tests/unit.suite.dist.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Codeception Test Suite Configuration - -# suite for unit (internal) tests. -# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. - -class_name: CodeGuy -modules: - enabled: - - CodeHelper diff --git a/apps/basic/tests/unit.suite.yml b/apps/basic/tests/unit.suite.yml new file mode 100644 index 0000000..be2874d --- /dev/null +++ b/apps/basic/tests/unit.suite.yml @@ -0,0 +1,9 @@ +# Codeception Test Suite Configuration + +# suite for unit (internal) tests. +# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. + +class_name: CodeGuy +modules: + enabled: + - CodeHelper diff --git a/apps/basic/tests/unit/_bootstrap.php b/apps/basic/tests/unit/_bootstrap.php index f37625b..8592f19 100644 --- a/apps/basic/tests/unit/_bootstrap.php +++ b/apps/basic/tests/unit/_bootstrap.php @@ -2,7 +2,4 @@ // add unit testing specific bootstrap code here -yii\codeception\TestCase::$appConfig = yii\helpers\ArrayHelper::merge( - require(__DIR__ . '/../../config/web.php'), - require(__DIR__ . '/../../config/codeception/unit.php') -); +yii\codeception\TestCase::$appConfig = require(__DIR__ . '/_config.php'); diff --git a/apps/basic/tests/unit/_config.php b/apps/basic/tests/unit/_config.php new file mode 100644 index 0000000..6eac4f9 --- /dev/null +++ b/apps/basic/tests/unit/_config.php @@ -0,0 +1,17 @@ + [ + 'fixture' => [ + 'class' => 'yii\test\DbFixtureManager', + 'basePath' => '@tests/unit/fixtures', + ], + 'db' => [ + 'dsn' => 'mysql:host=localhost;dbname=yii2_basic_unit', + ], + ], +]);