diff --git a/assets/AppAsset.php b/assets/AppAsset.php index 3d40487ae..d9d4cc430 100644 --- a/assets/AppAsset.php +++ b/assets/AppAsset.php @@ -1,4 +1,5 @@ validate()) { - return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0); + return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0); } return false; } diff --git a/requirements.php b/requirements.php index c1a6bf680..db69a36ee 100644 --- a/requirements.php +++ b/requirements.php @@ -1,4 +1,5 @@ amOnPage(Url::toRoute('/site/contact')); } - + public function contactPageWorks(AcceptanceTester $I) { $I->wantTo('ensure that contact page works'); @@ -25,7 +25,7 @@ public function contactFormCanBeSubmitted(AcceptanceTester $I) $I->fillField('#contactform-verifycode', 'testme'); $I->click('contact-button'); - + $I->wait(2); // wait for button to be clicked $I->dontSeeElement('#contact-form'); diff --git a/tests/acceptance/HomeCest.php b/tests/acceptance/HomeCest.php index e65df16ae..98fb6b9f7 100644 --- a/tests/acceptance/HomeCest.php +++ b/tests/acceptance/HomeCest.php @@ -6,13 +6,13 @@ class HomeCest { public function ensureThatHomePageWorks(AcceptanceTester $I) { - $I->amOnPage(Url::toRoute('/site/index')); + $I->amOnPage(Url::toRoute('/site/index')); $I->see('My Company'); - + $I->seeLink('About'); $I->click('About'); $I->wait(2); // wait for page to be opened - + $I->see('This is the About page.'); } } diff --git a/tests/functional/ContactFormCest.php b/tests/functional/ContactFormCest.php index d17ef52fd..f1ccaf18f 100644 --- a/tests/functional/ContactFormCest.php +++ b/tests/functional/ContactFormCest.php @@ -1,6 +1,6 @@ see('Contact', 'h1'); + $I->see('Contact', 'h1'); } public function submitEmptyForm(\FunctionalTester $I) @@ -38,7 +38,7 @@ public function submitFormWithIncorrectEmail(\FunctionalTester $I) $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'); + $I->dontSee('The verification code is incorrect', '.help-inline'); } public function submitFormSuccessfully(\FunctionalTester $I) @@ -52,6 +52,6 @@ public function submitFormSuccessfully(\FunctionalTester $I) ]); $I->seeEmailIsSent(); $I->dontSeeElement('#contact-form'); - $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); + $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); } } diff --git a/tests/functional/LoginFormCest.php b/tests/functional/LoginFormCest.php index 7a83a27d6..a1545a706 100644 --- a/tests/functional/LoginFormCest.php +++ b/tests/functional/LoginFormCest.php @@ -10,7 +10,6 @@ public function _before(\FunctionalTester $I) public function openLoginPage(\FunctionalTester $I) { $I->see('Login', 'h1'); - } // demonstrates `amLoggedInAs` method @@ -54,6 +53,6 @@ public function loginSuccessfully(\FunctionalTester $I) 'LoginForm[password]' => 'admin', ]); $I->see('Logout (admin)'); - $I->dontSeeElement('form#login-form'); + $I->dontSeeElement('form#login-form'); } -} \ No newline at end of file +} diff --git a/tests/unit/models/LoginFormTest.php b/tests/unit/models/LoginFormTest.php index 3c1dcddaa..6f96c2377 100644 --- a/tests/unit/models/LoginFormTest.php +++ b/tests/unit/models/LoginFormTest.php @@ -47,5 +47,4 @@ public function testLoginCorrect() verify(\Yii::$app->user->isGuest)->false(); verify($this->model->errors)->arrayHasNotKey('password'); } - } diff --git a/tests/unit/models/UserTest.php b/tests/unit/models/UserTest.php index 28986cbbd..3db9772a3 100644 --- a/tests/unit/models/UserTest.php +++ b/tests/unit/models/UserTest.php @@ -19,7 +19,7 @@ public function testFindUserByAccessToken() verify($user = User::findIdentityByAccessToken('100-token'))->notEmpty(); verify($user->username)->equals('admin'); - verify(User::findIdentityByAccessToken('non-existing'))->empty(); + verify(User::findIdentityByAccessToken('non-existing'))->empty(); } public function testFindUserByUsername() @@ -38,7 +38,6 @@ public function testValidateUser() verify($user->validateAuthKey('test102key'))->empty(); verify($user->validatePassword('admin'))->notEmpty(); - verify($user->validatePassword('123456'))->empty(); + verify($user->validatePassword('123456'))->empty(); } - } diff --git a/tests/unit/widgets/AlertTest.php b/tests/unit/widgets/AlertTest.php index e9857a161..af2db5d21 100644 --- a/tests/unit/widgets/AlertTest.php +++ b/tests/unit/widgets/AlertTest.php @@ -177,7 +177,8 @@ public function testMultipleWarningMessages() verify($renderingResult)->stringNotContainsString('alert-info'); } - public function testSingleMixedMessages() { + public function testSingleMixedMessages() + { $errorMessage = 'This is an error message'; $dangerMessage = 'This is a danger message'; $successMessage = 'This is a success message'; @@ -204,7 +205,8 @@ public function testSingleMixedMessages() { verify($renderingResult)->stringContainsString('alert-warning'); } - public function testMultipleMixedMessages() { + public function testMultipleMixedMessages() + { $firstErrorMessage = 'This is the first error message'; $secondErrorMessage = 'This is the second error message'; $firstDangerMessage = 'This is the first danger message';