]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
test
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Sun, 24 Mar 2024 18:48:49 +0000 (21:48 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Sun, 24 Mar 2024 18:48:49 +0000 (21:48 +0300)
12 files changed:
erp24/actions/payroll/ManagementAction.php
erp24/records/Products1c.php
erp24/tests/_support/FunctionalTester.php
erp24/tests/_support/UnitTester.php
erp24/tests/fixtures/CityFixture.php
erp24/tests/functional/CityCest.php [deleted file]
erp24/tests/functional/ContactFormCest.php [deleted file]
erp24/tests/functional/LoginFormCest.php [deleted file]
erp24/tests/functional/PageListCest.php
erp24/tests/unit/models/CityTest.php [deleted file]
erp24/tests/unit/models/ContactFormTest.php [deleted file]
erp24/tests/unit/models/LoginFormTest.php [deleted file]

index 6d01e99034d491c8456d4434b63bcd65480943a3..a0d101287eabf19584f00f0fc61ff2ee509f2457 100755 (executable)
@@ -88,7 +88,6 @@ class ManagementAction extends Action
                         $scriptLauncherLogObj->active = 0;
                         $scriptLauncherLogObj->status = 9;
                         $scriptLauncherLogObj->save();
-                        Yii::$app->cache->set("addAssignmentTask", false);
                     } else {
                         if ($scriptLauncherLog['active'] == 1) {
                             $errorText = 'Процесс формирования ведомости уже запущен в ' . $scriptLauncherLog['date_start'];
index 6816a71594d0b9e96547ba9123b08496a0b66359..72889c211457bda731305219f2b2db319d42d366 100644 (file)
@@ -245,10 +245,7 @@ class Products1c extends \yii\db\ActiveRecord
             
             WHERE
                 products_1c.name != ''
-            ",
-            [
-                ':search_in' => $searchIn,
-            ]
+            "
         );
 
         $data = $command->queryAll();
index 43327cb36fda5bc9aaa83cf25f8abb87ae0da6c1..b7d4046186dd855df8c68ead453f4a7ea8066f5c 100755 (executable)
@@ -1,5 +1,4 @@
 <?php
-namespace backend\tests;
 
 use Codeception\Actor;
 use Codeception\Lib\Friend;
index 36e1ebade7e32ed333ad67c55a6013826c293ae0..2e06faa2061199be3360685b50019388e94b270f 100755 (executable)
@@ -1,5 +1,4 @@
 <?php
-namespace backend\tests;
 
 use Codeception\Actor;
 use Codeception\Lib\Friend;
index 44d0e70d6e5caaf329fbb5d5c64902f2fe9bb634..5bcb4070a7af91303050814652691713f09bd504 100755 (executable)
@@ -1,5 +1,5 @@
 <?php
-namespace backend\tests\fixtures;
+namespace tests\fixtures;
 
 use yii\test\ActiveFixture;
 
diff --git a/erp24/tests/functional/CityCest.php b/erp24/tests/functional/CityCest.php
deleted file mode 100755 (executable)
index 166acb3..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php namespace backend\tests\functional;
-use backend\models\City;
-use backend\tests\fixtures\CityFixture;
-use backend\tests\FunctionalTester;
-use Codeception\Example;
-use common\fixtures\UserFixture;
-
-class CityCest
-{
-    public function _before(FunctionalTester $I)
-    {
-    }
-
-       /**
-        * Load fixtures before db transaction begin
-        * Called in _before()
-        * @see \Codeception\Module\Yii2::_before()
-        * @see \Codeception\Module\Yii2::loadFixtures()
-        * @return array
-        */
-       public function _fixtures()
-       {
-               return [
-                       'user' => [
-                               'class' => UserFixture::className(),
-                               'dataFile' => codecept_data_dir() . 'login_data.php'
-                       ],
-                       'city' => [
-                               'class' => CityFixture::className(),
-                               'dataFile' => codecept_data_dir() . 'city.php'
-                       ]
-
-               ];
-       }
-
-       /**
-        * @param FunctionalTester $I
-        * @dataProvider pageProvider
-        */
-       public function testSortLinkClick(FunctionalTester $I, Example $data)
-       {
-               $pageH1 = 'Города';
-               $I->amLoggedInAs(1);
-
-               $I->amOnPage('/city/');
-               $I->see($pageH1, 'h1');
-               $I->click(['link' => $data['link']]);
-               $I->see($pageH1, 'h1');
-               $I->seeInTitle($pageH1);
-               $I->click(['link' => $data['link']]);
-               $I->see($pageH1, 'h1');
-               $I->seeInTitle($pageH1);
-
-       }
-
-       /**
-        * @return array
-        */
-       protected function pageProvider()
-       {
-               return [
-                       ['link'=>"Название"],
-                       ['link'=>"Символьный код"],
-                       ['link'=>"Телефон"],
-                       ['link'=>"Активность"],
-               ];
-       }
-
-
-
-       /**
-        * @param FunctionalTester $I
-        */
-       public function createCity(FunctionalTester $I)
-       {
-
-               $I->amLoggedInAs(1);
-
-               $I->amOnPage('/city/create/');
-               $I->fillField('City[name]', 'Город Город');
-               $I->fillField('City[code]', 'codecity');
-               $I->fillField('City[phone]', '+7 (132) 4-542-132');
-               $I->click('Сохранить');
-
-               $I->see('Город Город');
-
-       }
-
-       /**
-        * @param FunctionalTester $I
-        */
-       public function viewCity(FunctionalTester $I)
-       {
-               $I->amLoggedInAs(1);
-
-               $model = City::find()->one();
-
-               $urlView = '/city/view/'.$model->id.'/';
-               $name = $model->name;
-               $I->amOnPage($urlView);
-               $I->click(['link' => 'Изменить']);
-
-               $I->see($name);
-
-       }
-
-       /**
-        * @param FunctionalTester $I
-        */
-       public function updateCity(FunctionalTester $I)
-       {
-               $I->amLoggedInAs(1);
-
-               $model = City::find()->one();
-
-               $urlView = '/city/update/'.$model->id.'/';
-               $name = $model->name;
-               $I->amOnPage($urlView);
-               $I->click('Сохранить');
-
-               $I->see($name);
-
-       }
-}
diff --git a/erp24/tests/functional/ContactFormCest.php b/erp24/tests/functional/ContactFormCest.php
deleted file mode 100644 (file)
index d17ef52..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-class ContactFormCest 
-{
-    public function _before(\FunctionalTester $I)
-    {
-        $I->amOnRoute('site/contact');
-    }
-
-    public function openContactPage(\FunctionalTester $I)
-    {
-        $I->see('Contact', 'h1');        
-    }
-
-    public function submitEmptyForm(\FunctionalTester $I)
-    {
-        $I->submitForm('#contact-form', []);
-        $I->expectTo('see validations errors');
-        $I->see('Contact', 'h1');
-        $I->see('Name cannot be blank');
-        $I->see('Email cannot be blank');
-        $I->see('Subject cannot be blank');
-        $I->see('Body cannot be blank');
-        $I->see('The verification code is incorrect');
-    }
-
-    public function submitFormWithIncorrectEmail(\FunctionalTester $I)
-    {
-        $I->submitForm('#contact-form', [
-            'ContactForm[name]' => 'tester',
-            'ContactForm[email]' => 'tester.email',
-            'ContactForm[subject]' => 'test subject',
-            'ContactForm[body]' => 'test content',
-            'ContactForm[verifyCode]' => 'testme',
-        ]);
-        $I->expectTo('see that email address is wrong');
-        $I->dontSee('Name cannot be blank', '.help-inline');
-        $I->see('Email is not a valid email address.');
-        $I->dontSee('Subject cannot be blank', '.help-inline');
-        $I->dontSee('Body cannot be blank', '.help-inline');
-        $I->dontSee('The verification code is incorrect', '.help-inline');        
-    }
-
-    public function submitFormSuccessfully(\FunctionalTester $I)
-    {
-        $I->submitForm('#contact-form', [
-            'ContactForm[name]' => 'tester',
-            'ContactForm[email]' => 'tester@example.com',
-            'ContactForm[subject]' => 'test subject',
-            'ContactForm[body]' => 'test content',
-            'ContactForm[verifyCode]' => 'testme',
-        ]);
-        $I->seeEmailIsSent();
-        $I->dontSeeElement('#contact-form');
-        $I->see('Thank you for contacting us. We will respond to you as soon as possible.');        
-    }
-}
diff --git a/erp24/tests/functional/LoginFormCest.php b/erp24/tests/functional/LoginFormCest.php
deleted file mode 100644 (file)
index 7a83a27..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-class LoginFormCest
-{
-    public function _before(\FunctionalTester $I)
-    {
-        $I->amOnRoute('site/login');
-    }
-
-    public function openLoginPage(\FunctionalTester $I)
-    {
-        $I->see('Login', 'h1');
-
-    }
-
-    // demonstrates `amLoggedInAs` method
-    public function internalLoginById(\FunctionalTester $I)
-    {
-        $I->amLoggedInAs(100);
-        $I->amOnPage('/');
-        $I->see('Logout (admin)');
-    }
-
-    // demonstrates `amLoggedInAs` method
-    public function internalLoginByInstance(\FunctionalTester $I)
-    {
-        $I->amLoggedInAs(\app\models\User::findByUsername('admin'));
-        $I->amOnPage('/');
-        $I->see('Logout (admin)');
-    }
-
-    public function loginWithEmptyCredentials(\FunctionalTester $I)
-    {
-        $I->submitForm('#login-form', []);
-        $I->expectTo('see validations errors');
-        $I->see('Username cannot be blank.');
-        $I->see('Password cannot be blank.');
-    }
-
-    public function loginWithWrongCredentials(\FunctionalTester $I)
-    {
-        $I->submitForm('#login-form', [
-            'LoginForm[username]' => 'admin',
-            'LoginForm[password]' => 'wrong',
-        ]);
-        $I->expectTo('see validations errors');
-        $I->see('Incorrect username or password.');
-    }
-
-    public function loginSuccessfully(\FunctionalTester $I)
-    {
-        $I->submitForm('#login-form', [
-            'LoginForm[username]' => 'admin',
-            'LoginForm[password]' => 'admin',
-        ]);
-        $I->see('Logout (admin)');
-        $I->dontSeeElement('form#login-form');              
-    }
-}
\ No newline at end of file
index c9a1e607dfa104a7fefccfc6036c2ae9c0f82b1e..ada59ba5b52177b046f7518ef63589a175e21393 100644 (file)
@@ -1,11 +1,12 @@
 <?php
 
-namespace app\tests\functional;
+namespace tests\functional;
 class PageListCest
 {
     public function shiftSalesInterface(\FunctionalTester $I)
     {
-        $I->amLoggedInAs(\app\models\User::findByUsername('admin'));
+        $tt = 2;
+//        $I->amLoggedInAs(Admin::findByUsername('root'));
         $I->amOnPage('/info-table/shift-sales');
         $I->see('Login', 'h1');
     }
diff --git a/erp24/tests/unit/models/CityTest.php b/erp24/tests/unit/models/CityTest.php
deleted file mode 100755 (executable)
index 788ab43..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-<?php
-
-namespace backend\tests\unit\models;
-
-use Codeception\Test\Unit;
-use common\tests\UnitTester;
-use Yii;
-use backend\models\City;
-use backend\tests\fixtures\CityFixture;
-
-/**
- * Login form test
- */
-class CityTest extends Unit
-{
-    /**
-     * @var UnitTester
-     */
-    protected $tester;
-       protected $className;
-
-       protected function _before()
-       {
-
-               $this->className = City::className();
-
-       }
-
-
-    /**
-     * @return array
-     */
-    public function _fixtures()
-    {
-        return [
-            'city' => [
-                'class' => CityFixture::className(),
-                'dataFile' => codecept_data_dir() . 'city.php'
-            ]
-        ];
-    }
-
-       public function testEmptyValues()
-       {
-               $model = new $this->className;
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-       }
-
-       public function testNameOnly()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'name' => 'Город'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-
-       }
-       public function testWrongName()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'name' => 'one title'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key name must have in array errors', $model->errors)->hasKey('name');
-
-       }
-
-       public function testShortName()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'name' => 'H'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key name must have in array errors', $model->errors)->hasKey('name');
-
-       }
-
-       public function testFieldActiveNotInteger()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'active' => 'string'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key active must have in array errors', $model->errors)->hasKey('active');
-
-       }
-
-       public function testLongPhoneSupport()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'phone_support' => '123456789012345678901'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key phone_support must have in array errors', $model->errors)->hasKey('phone_support');
-
-       }
-
-       /**
-        * @dataProvider providerIntegerFields
-        */
-       public function testIntegerFieldsWrongSetRussianText($a)
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       $a => 'Название'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key '.$a.' must have in array errors', $model->errors)->hasKey($a);
-
-       }
-
-       /**
-        * @return array
-        */
-       public function providerIntegerFields()
-       {
-               $obj = new City();
-               return $obj->getAllFieldsGroupByType()->getFieldsByType('integer');
-       }
-
-
-       public function testLongPhone()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'phone' => '123456789012345678901'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key phone must have in array errors', $model->errors)->hasKey('phone');
-
-       }
-
-       public function testLongName()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'name' => 'цщукзшгецзщушкгезщцушкгезщцшугкещзшугкцезщшгцзукешгцушгкеншщцугкенщшгншщгцункещшцгукеншщгцкежрлордорфжваопрфваопрылжвоапрыдлвоапрывалопрылдвоапрылваопрлыдпаловаарыплдоршдкгеншгукрпвшгкеершупоыаршгнкешыгарлыовврппршгыукрлпоыршгыукршшывгралопршыгкршорпчлоавр'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key name must have in array errors', $model->errors)->hasKey('name');
-
-       }
-
-       public function testLongCode()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'code' => 'qwertwpieurtypiweurtyiweurtyioweurytioweurytioweurtyioaslkjdfhklajfhlkjahfklgjahdkfjghkadjfgkajdfgkajddfhgkajddfhkgkjaddhfkgkjadhfkgkjahdkfjghklazcvbvbzkcvjhblzkcvjhblkzjcvhblkzuvycoiuzyoiuyzouvybozhvblzvzuvbhoizuvcybiozucvhbzjcvhobzciuvhkjewrhtklwjehrtklj'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key code must have in array errors', $model->errors)->hasKey('code');
-
-       }
-
-//[['name', 'code', 'phone', 'email'], 'string', 'min' => 2, 'max' => 255],
-       public function testShortPhoneSupport()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'phone_support' => '1'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key phone_support must have in array errors', $model->errors)->hasKey('phone_support');
-
-       }
-
-       public function testShortPhone()
-       {
-               $model = new $this->className;
-
-               $model->attributes = [
-                       'phone' => '1'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key phone must have in array errors', $model->errors)->hasKey('phone');
-
-       }
-
-       public function testNotUniqueName()
-       {
-               $model = new $this->className;
-
-               $nameCityTest = 'Город тест';
-
-               $model->attributes = [
-                       'name' => $nameCityTest,
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect($model->getFirstError('name'));
-               expect('key name must have in array errors', $model->errors)->hasKey('name');
-
-       }
-
-       public function testNotUniqueCode()
-       {
-               $model = new $this->className;
-
-               $codeTest = 'city-test';
-
-//             $message = 'Значение «'.$codeTest.'» для «Символьный код» уже занято.';
-
-               $model->attributes = [
-                       'code' => $codeTest,
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-               expect('key code must have in array errors', $model->errors)->hasKey('code');
-       }
-
-       public function testWrongCode()
-       {
-               $model = new $this->className;
-
-               $codeTest = 'фываы';
-
-//             $message = 'Значение «'.$codeTest.'» для «Символьный код» уже занято.';
-
-               $model->attributes = [
-                       'code' => $codeTest,
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-//             $test = $model->getFirstError('code');
-//             expect($model->getFirstError('code'))->equals($message);
-               expect('key code must have in array errors', $model->errors)->hasKey('code');
-
-       }
-
-    public function testCityWrongMail()
-    {
-               $model = new $this->className;
-               $model->attributes = [
-                       'email' => 'WrongMail'
-               ];
-
-               $validate = $model->validate();
-
-               expect('Validation should be failed', $validate)->false();
-               expect($model->hasErrors())->true();
-//             expect($model->getFirstError('email'))->equals('Значение «E-mail» не является правильным email адресом.');
-           expect('key email must have in array errors', $model->errors)->hasKey('email');
-       }
-
-    public function testTrueCity()
-    {
-               $model = new $this->className;
-           $expectedAttrs = [
-                   'name' => 'Город Тест Тест',
-                   'code' => 'testcode',
-                   'phone' => '+7 (332) 4-375-847',
-                   'email' => 'nicuole.pacek@schultz.info',
-                   'phone_support' => '8 800 770 70 22',
-                   'active' => '1',
-                   'created_at' => '1402312317',
-                   'updated_at' => '1402312317',
-           ];
-
-               $model->attributes = $expectedAttrs;
-
-               expect('Validation should be success', $model->validate())->true();
-               expect($model->hasErrors())->false();
-
-           $this->assertTrue($model->save());
-
-           $expectedAttrs['id'] = $model->id;
-
-           $city = City::find()->where(['id' =>$expectedAttrs['id']])->one();
-           $this->assertNotNull($city);
-
-           $this->assertEquals($expectedAttrs['name'], $city->name);
-           $this->tester->assertEquals($expectedAttrs['name'], $city->name);
-
-               $this->assertEquals($expectedAttrs['email'], $city->email);
-               $this->assertEquals($expectedAttrs['code'], $city->code);
-
-       }
-
-       public function testDeleteCity()
-       {
-               // delete
-               $record = new $this->className;
-               $record->name = 'Город Тест Тест Первый Тест';
-               $record->code = 'testcode';
-               $record->phone = '+7 (332) 4-375-847';
-               $record->email = 'nicuole.pacek@schultz.info';
-               $record->phone_support = '8 800 770 70 22';
-               $record->active = 1;
-               $record->created_at = 1402312317;
-               $record->updated_at = 1402312317;
-
-               $record->save();
-
-               $recordId = $record->id;
-
-               $record = City::findOne($recordId);
-               $record->delete();
-               $record = City::findOne($recordId);
-               $this->assertNull($record);
-
-               // deleteAll
-               $record = new $this->className;
-               $record->name = 'Город Тест Тест Второй Тест';
-               $record->code = 'testcode';
-               $record->phone = '+7 (332) 4-375-847';
-               $record->email = 'nicuole.pacek@schultz.info';
-               $record->phone_support = '8 800 770 70 22';
-               $record->active = 1;
-               $record->created_at = 1402312317;
-               $record->updated_at = 1402312317;
-               $record->save();
-
-               $ret = City::deleteAll(['name' => 'Город Тест Тест Второй Тест']);
-               $this->assertEquals(1, $ret);
-               $records = City::find()->where(['name' => 'Город Тест Тест Второй Тест'])->all();
-               $this->assertEquals(0, count($records));
-       }
-}
diff --git a/erp24/tests/unit/models/ContactFormTest.php b/erp24/tests/unit/models/ContactFormTest.php
deleted file mode 100644 (file)
index 1bb1bb2..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-namespace tests\unit\models;
-
-use app\models\ContactForm;
-use yii\mail\MessageInterface;
-
-class ContactFormTest extends \Codeception\Test\Unit
-{
-    /**
-     * @var \UnitTester
-     */
-    public $tester;
-
-    public function testEmailIsSentOnContact()
-    {
-        $model = new ContactForm();
-
-        $model->attributes = [
-            'name' => 'Tester',
-            'email' => 'tester@example.com',
-            'subject' => 'very important letter subject',
-            'body' => 'body of current message',
-            'verifyCode' => 'testme',
-        ];
-
-        verify($model->contact('admin@example.com'))->notEmpty();
-
-        // using Yii2 module actions to check email was sent
-        $this->tester->seeEmailIsSent();
-
-        /** @var MessageInterface $emailMessage */
-        $emailMessage = $this->tester->grabLastSentEmail();
-        verify($emailMessage)->instanceOf('yii\mail\MessageInterface');
-        verify($emailMessage->getTo())->arrayHasKey('admin@example.com');
-        verify($emailMessage->getFrom())->arrayHasKey('noreply@example.com');
-        verify($emailMessage->getReplyTo())->arrayHasKey('tester@example.com');
-        verify($emailMessage->getSubject())->equals('very important letter subject');
-        verify($emailMessage->toString())->stringContainsString('body of current message');
-    }
-}
diff --git a/erp24/tests/unit/models/LoginFormTest.php b/erp24/tests/unit/models/LoginFormTest.php
deleted file mode 100644 (file)
index 3c1dcdd..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-namespace tests\unit\models;
-
-use app\models\LoginForm;
-
-class LoginFormTest extends \Codeception\Test\Unit
-{
-    private $model;
-
-    protected function _after()
-    {
-        \Yii::$app->user->logout();
-    }
-
-    public function testLoginNoUser()
-    {
-        $this->model = new LoginForm([
-            'username' => 'not_existing_username',
-            'password' => 'not_existing_password',
-        ]);
-
-        verify($this->model->login())->false();
-        verify(\Yii::$app->user->isGuest)->true();
-    }
-
-    public function testLoginWrongPassword()
-    {
-        $this->model = new LoginForm([
-            'username' => 'demo',
-            'password' => 'wrong_password',
-        ]);
-
-        verify($this->model->login())->false();
-        verify(\Yii::$app->user->isGuest)->true();
-        verify($this->model->errors)->arrayHasKey('password');
-    }
-
-    public function testLoginCorrect()
-    {
-        $this->model = new LoginForm([
-            'username' => 'demo',
-            'password' => 'demo',
-        ]);
-
-        verify($this->model->login())->true();
-        verify(\Yii::$app->user->isGuest)->false();
-        verify($this->model->errors)->arrayHasNotKey('password');
-    }
-
-}