mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Описана базовая миграция, добавлена модель аккаунта, добавлена модель авторизации, написаны первичные тесты для этой модели, добавлен модуль авторизации, настроен базовый контроллер. Короче много чего сделано
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace tests\codeception\common\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* Represents loging page
|
||||
* @property \codeception_api\AcceptanceTester|\codeception_api\FunctionalTester $actor
|
||||
*/
|
||||
class LoginPage extends BasePage
|
||||
{
|
||||
public $route = 'site/login';
|
||||
|
||||
/**
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*/
|
||||
public function login($username, $password)
|
||||
{
|
||||
$this->actor->fillField('input[name="LoginForm[username]"]', $username);
|
||||
$this->actor->fillField('input[name="LoginForm[password]"]', $password);
|
||||
$this->actor->click('login-button');
|
||||
}
|
||||
}
|
@@ -63,10 +63,10 @@ class FixtureHelper extends Module
|
||||
public function fixtures()
|
||||
{
|
||||
return [
|
||||
'user' => [
|
||||
'class' => UserFixture::className(),
|
||||
'dataFile' => '@tests/codeception/common/fixtures/data/init_login.php',
|
||||
],
|
||||
//'user' => [
|
||||
// 'class' => UserFixture::className(),
|
||||
// 'dataFile' => '@tests/codeception/common/fixtures/data/init_login.php',
|
||||
//],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
12
tests/codeception/common/fixtures/AccountFixture.php
Normal file
12
tests/codeception/common/fixtures/AccountFixture.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace tests\codeception\common\fixtures;
|
||||
|
||||
use common\models\Account;
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class AccountFixture extends ActiveFixture {
|
||||
|
||||
public $modelClass = Account::class;
|
||||
|
||||
}
|
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace tests\codeception\common\unit\models;
|
||||
|
||||
use Yii;
|
||||
use tests\codeception\common\unit\DbTestCase;
|
||||
use api\models\LoginForm;
|
||||
use Codeception\Specify;
|
||||
use common\models\LoginForm;
|
||||
use tests\codeception\common\fixtures\UserFixture;
|
||||
use tests\codeception\common\unit\DbTestCase;
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* Login form test
|
||||
|
Reference in New Issue
Block a user