2016-02-14 23:20:10 +05:30
|
|
|
<?php
|
|
|
|
namespace tests\codeception\api\functional\_steps;
|
|
|
|
|
|
|
|
use tests\codeception\api\_pages\LoginRoute;
|
|
|
|
use tests\codeception\api\FunctionalTester;
|
|
|
|
|
|
|
|
class AccountSteps extends FunctionalTester {
|
|
|
|
|
|
|
|
public function loggedInAsActiveAccount() {
|
|
|
|
$I = $this;
|
|
|
|
$route = new LoginRoute($I);
|
|
|
|
$route->login('Admin', 'password_0');
|
|
|
|
$I->canSeeResponseIsJson();
|
2016-02-24 03:45:04 +05:30
|
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.jwt');
|
|
|
|
$jwt = $I->grabDataFromResponseByJsonPath('$.jwt')[0];
|
|
|
|
$I->amBearerAuthenticated($jwt);
|
2016-02-14 23:20:10 +05:30
|
|
|
}
|
|
|
|
|
2016-02-27 03:52:09 +05:30
|
|
|
public function notLoggedIn() {
|
|
|
|
$this->haveHttpHeader('Authorization', null);
|
|
|
|
}
|
|
|
|
|
2016-02-14 23:20:10 +05:30
|
|
|
}
|