Commit c9d51ee0 by Alexander Makarov

Adjusted testing namespaces in application templates

parent 2af195d8
......@@ -18,4 +18,4 @@ $_SERVER['SCRIPT_FILENAME'] = YII_TEST_BACKEND_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = YII_BACKEND_TEST_ENTRY_URL;
$_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', dirname(__DIR__));
Yii::setAlias('@tests', dirname(dirname(__DIR__)));
......@@ -12,7 +12,7 @@ class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- codeception\common\_support\FixtureHelper
- tests\codeception\common\_support\FixtureHelper
# you can use WebDriver instead of PhpBrowser to test javascript and ajax.
# This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium
# "restart" option is used by the WebDriver to start each time per test-file new session and cookies,
......
<?php
use codeception_backend\AcceptanceTester;
use codeception\common\_pages\LoginPage;
use tests\codeception\backend\AcceptanceTester;
use tests\codeception\common\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure login page works');
......
namespace: codeception_backend
namespace: tests\codeception\backend
actor: Tester
paths:
tests: .
......
......@@ -11,7 +11,7 @@ modules:
enabled:
- Filesystem
- Yii2
- codeception\common\_support\FixtureHelper
- tests\codeception\common\_support\FixtureHelper
config:
Yii2:
configFile: '../config/backend/functional.php'
<?php
use codeception_backend\FunctionalTester;
use codeception\common\_pages\LoginPage;
use tests\codeception\backend\FunctionalTester;
use tests\codeception\common\_pages\LoginPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure login page works');
......
......@@ -4,5 +4,5 @@ namespace backend\tests\unit;
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@codeception/config/backend/unit.php';
public $appConfig = '@tests/codeception/config/backend/unit.php';
}
......@@ -4,5 +4,5 @@ namespace backend\tests\unit;
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@codeception/config/backend/unit.php';
public $appConfig = '@tests/codeception/config/backend/unit.php';
}
......@@ -11,4 +11,4 @@ require(YII_APP_BASE_PATH . '/common/config/aliases.php');
// set correct script paths
$_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', dirname(__DIR__));
\ No newline at end of file
Yii::setAlias('@tests', dirname(dirname(__DIR__)));
\ No newline at end of file
<?php
namespace codeception\common\_pages;
namespace tests\codeception\common\_pages;
use yii\codeception\BasePage;
......
<?php
namespace codeception\common\_support;
namespace tests\codeception\common\_support;
use codeception\common\fixtures\UserFixture;
use tests\codeception\common\fixtures\UserFixture;
use Codeception\Module;
use yii\test\FixtureTrait;
......@@ -53,7 +53,7 @@ class FixtureHelper extends Module
return [
'user' => [
'class' => UserFixture::className(),
'dataFile' => '@codeception/common/fixtures/data/init_login.php',
'dataFile' => '@tests/codeception/common/fixtures/data/init_login.php',
],
];
}
......
namespace: codeception_common
namespace: tests\codeception\common
actor: Tester
paths:
tests: .
......
<?php
namespace codeception\common\fixtures;
namespace tests\codeception\common\fixtures;
use yii\test\ActiveFixture;
......
<?php
namespace codeception\common\unit;
namespace tests\codeception\common\unit;
/**
* @inheritdoc
*/
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@codeception/config/common/unit.php';
public $appConfig = '@tests/codeception/config/common/unit.php';
}
<?php
namespace common\tests\unit;
namespace tests\codeception\common\unit;
/**
* @inheritdoc
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@codeception/config/common/unit.php';
public $appConfig = '@tests/codeception/config/common/unit.php';
}
<?php
namespace codeception\common\unit\models;
namespace tests\codeception\common\unit\models;
use Yii;
use codeception\common\unit\DbTestCase;
use tests\codeception\common\unit\DbTestCase;
use Codeception\Specify;
use common\models\LoginForm;
use codeception\common\fixtures\UserFixture;
use tests\codeception\common\fixtures\UserFixture;
/**
* Login form test
......@@ -86,7 +86,7 @@ class LoginFormTest extends DbTestCase
return [
'user' => [
'class' => UserFixture::className(),
'dataFile' => '@codeception/common/unit/fixtures/data/models/user.php'
'dataFile' => '@tests/codeception/common/unit/fixtures/data/models/user.php'
],
];
}
......
......@@ -11,4 +11,4 @@ require(YII_APP_BASE_PATH . '/common/config/aliases.php');
// set correct script paths
$_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', dirname(__DIR__));
\ No newline at end of file
Yii::setAlias('@tests', dirname(dirname(__DIR__)));
\ No newline at end of file
namespace: codeception_console
namespace: tests\codeception\console
actor: Tester
paths:
tests: .
......
<?php
namespace console\tests\unit;
namespace tests\codeception\console\unit;
/**
* @inheritdoc
*/
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@codeception/config/console/config.php';
public $appConfig = '@tests/codeception/config/console/config.php';
}
<?php
namespace console\tests\unit;
namespace tests\codeception\console\unit;
/**
* @inheritdoc
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@codeception/config/console/config.php';
public $appConfig = '@tests/codeception/config/console/config.php';
}
......@@ -18,4 +18,4 @@ $_SERVER['SCRIPT_FILENAME'] = FRONTEND_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = FRONTEND_ENTRY_URL;
$_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', dirname(__DIR__));
\ No newline at end of file
Yii::setAlias('@tests', dirname(dirname(__DIR__)));
\ No newline at end of file
<?php
namespace codeception\frontend\_pages;
namespace tests\codeception\frontend\_pages;
use yii\codeception\BasePage;
......
<?php
namespace codeception\frontend\_pages;
namespace tests\codeception\frontend\_pages;
use yii\codeception\BasePage;
......
<?php
namespace codeception\frontend\_pages;
namespace tests\codeception\frontend\_pages;
use \yii\codeception\BasePage;
......
......@@ -12,7 +12,7 @@ class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- codeception\common\_support\FixtureHelper
- tests\codeception\common\_support\FixtureHelper
# you can use WebDriver instead of PhpBrowser to test javascript and ajax.
# This will require you to install selenium. See http://codeception.com/docs/04-AcceptanceTests#Selenium
# "restart" option is used by the WebDriver to start each time per test-file new session and cookies,
......
<?php
use codeception_frontend\AcceptanceTester;
use codeception\frontend\_pages\AboutPage;
use tests\codeception\frontend\AcceptanceTester;
use tests\codeception\frontend\_pages\AboutPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that about works');
......
<?php
use codeception_frontend\AcceptanceTester;
use codeception\frontend\_pages\ContactPage;
use tests\codeception\frontend\AcceptanceTester;
use tests\codeception\frontend\_pages\ContactPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that contact works');
......
<?php
use codeception_frontend\AcceptanceTester;
use tests\codeception\frontend\AcceptanceTester;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that home page works');
......
<?php
use codeception_frontend\AcceptanceTester;
use codeception\common\_pages\LoginPage;
use tests\codeception\frontend\AcceptanceTester;
use tests\codeception\common\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure login page works');
......
<?php
namespace codeception\frontend\acceptance;
namespace tests\codeception\frontend\acceptance;
use codeception\frontend\_pages\SignupPage;
use tests\codeception\frontend\_pages\SignupPage;
use common\models\User;
class SignupCest
......
namespace: codeception_frontend
namespace: tests\codeception\frontend
actor: Tester
paths:
tests: .
......
......@@ -11,7 +11,7 @@ modules:
enabled:
- Filesystem
- Yii2
- codeception\common\_support\FixtureHelper
- tests\codeception\common\_support\FixtureHelper
config:
Yii2:
configFile: '../config/frontend/functional.php'
<?php
use codeception_frontend\FunctionalTester;
use codeception\frontend\_pages\AboutPage;
use tests\codeception\frontend\FunctionalTester;
use tests\codeception\frontend\_pages\AboutPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that about works');
......
<?php
use codeception_frontend\FunctionalTester;
use codeception\frontend\_pages\ContactPage;
use tests\codeception\frontend\FunctionalTester;
use tests\codeception\frontend\_pages\ContactPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that contact works');
......
<?php
use codeception_frontend\FunctionalTester;
use tests\codeception\frontend\FunctionalTester;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that home page works');
$I->amOnPage(Yii::$app->homeUrl);
......
<?php
use codeception_frontend\FunctionalTester;
use codeception\common\_pages\LoginPage;
use tests\codeception\frontend\FunctionalTester;
use tests\codeception\common\_pages\LoginPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure login page works');
......
<?php
namespace codeception\frontend\functional;
namespace tests\codeception\frontend\functional;
use codeception\frontend\_pages\SignupPage;
use tests\codeception\frontend\_pages\SignupPage;
use common\models\User;
class SignupCest
......
<?php
namespace codeception\frontend\unit;
namespace tests\codeception\frontend\unit;
/**
* @inheritdoc
*/
class DbTestCase extends \yii\codeception\DbTestCase
{
public $appConfig = '@codeception/config/frontend/unit.php';
public $appConfig = '@tests/codeception/config/frontend/unit.php';
}
<?php
namespace codeception\frontend\unit;
namespace tests\codeception\frontend\unit;
/**
* @inheritdoc
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@codeception/config/frontend/unit.php';
public $appConfig = '@tests/codeception/config/frontend/unit.php';
}
<?php
namespace codeception\frontend\unit\models;
namespace tests\codeception\frontend\unit\models;
use Yii;
use codeception\frontend\unit\TestCase;
use tests\codeception\frontend\unit\TestCase;
use frontend\models\ContactForm;
class ContactFormTest extends TestCase
......
<?php
namespace codeception\frontend\tests\models;
namespace tests\codeception\frontend\models;
use Yii;
use codeception\frontend\unit\DbTestCase;
use tests\codeception\frontend\unit\DbTestCase;
use frontend\models\PasswordResetRequestForm;
use codeception\common\fixtures\UserFixture;
use tests\codeception\common\fixtures\UserFixture;
use common\models\User;
use Codeception\Specify;
......@@ -75,7 +75,7 @@ class PasswordResetRequestFormTest extends DbTestCase
return [
'user' => [
'class' => UserFixture::className(),
'dataFile' => '@codeception/frontend/unit/fixtures/data/models/user.php'
'dataFile' => '@tests/codeception/frontend/unit/fixtures/data/models/user.php'
],
];
}
......
<?php
namespace codeception\frontend\unit\models;
namespace tests\codeception\frontend\unit\models;
use codeception\frontend\unit\DbTestCase;
use codeception\common\fixtures\UserFixture;
use tests\codeception\frontend\unit\DbTestCase;
use tests\codeception\common\fixtures\UserFixture;
use frontend\models\ResetPasswordForm;
class ResetPasswordFormTest extends DbTestCase
......@@ -36,7 +36,7 @@ class ResetPasswordFormTest extends DbTestCase
return [
'user' => [
'class' => UserFixture::className(),
'dataFile' => '@codeception/frontend/unit/fixtures/data/models/user.php'
'dataFile' => '@tests/codeception/frontend/unit/fixtures/data/models/user.php'
],
];
}
......
<?php
namespace codeception\frontend\unit\models;
namespace tests\codeception\frontend\unit\models;
use codeception\frontend\unit\DbTestCase;
use codeception\common\fixtures\UserFixture;
use tests\codeception\frontend\unit\DbTestCase;
use tests\codeception\common\fixtures\UserFixture;
use Codeception\Specify;
use frontend\models\SignupForm;
......@@ -45,7 +45,7 @@ class SignupFormTest extends DbTestCase
return [
'user' => [
'class' => UserFixture::className(),
'dataFile' => '@codeception/frontend/unit/fixtures/data/models/user.php',
'dataFile' => '@tests/codeception/frontend/unit/fixtures/data/models/user.php',
],
];
}
......
......@@ -12,4 +12,4 @@ $_SERVER['SCRIPT_FILENAME'] = YII_TEST_ENTRY_FILE;
$_SERVER['SCRIPT_NAME'] = YII_TEST_ENTRY_URL;
$_SERVER['SERVER_NAME'] = 'localhost';
Yii::setAlias('@codeception', __DIR__);
Yii::setAlias('@tests', dirname(__DIR__));
<?php
namespace codeception\_pages;
namespace tests\codeception\_pages;
use yii\codeception\BasePage;
......
<?php
namespace codeception\_pages;
namespace tests\codeception\_pages;
use yii\codeception\BasePage;
......
<?php
namespace codeception\_pages;
namespace tests\codeception\_pages;
use yii\codeception\BasePage;
......
<?php
use codeception\_pages\AboutPage;
use tests\codeception\_pages\AboutPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that about works');
......
<?php
use codeception\_pages\ContactPage;
use tests\codeception\_pages\ContactPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that contact works');
......
<?php
use codeception\_pages\LoginPage;
use tests\codeception\_pages\LoginPage;
$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that login works');
......
<?php
use codeception\_pages\AboutPage;
use tests\codeception\_pages\AboutPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that about works');
......
<?php
use codeception\_pages\ContactPage;
use tests\codeception\_pages\ContactPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that contact works');
......
<?php
use codeception\_pages\LoginPage;
use tests\codeception\_pages\LoginPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that login works');
......
<?php
namespace codeception\unit\models;
namespace tests\codeception\unit\models;
use Yii;
use yii\codeception\TestCase;
......
<?php
namespace codeception\unit\models;
namespace tests\codeception\unit\models;
use Yii;
use yii\codeception\TestCase;
......
<?php
namespace codeception\unit\models;
namespace tests\codeception\unit\models;
use yii\codeception\TestCase;
......
......@@ -31,7 +31,7 @@ class TestCase extends Test
* The application configuration array may contain an optional `class` element which specifies the class
* name of the application instance to be created. By default, a [[\yii\web\Application]] instance will be created.
*/
public $appConfig = '@codeception/config/unit.php';
public $appConfig = '@tests/codeception/config/unit.php';
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment