mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Обновлён Codeception до версии 2.1
This commit is contained in:
38
tests/codeception/api/_support/FunctionalTester.php
Normal file
38
tests/codeception/api/_support/FunctionalTester.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace tests\codeception\api;
|
||||
|
||||
use tests\codeception\api\_pages\LoginRoute;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
* @method void wantToTest($text)
|
||||
* @method void wantTo($text)
|
||||
* @method void execute($callable)
|
||||
* @method void expectTo($prediction)
|
||||
* @method void expect($prediction)
|
||||
* @method void amGoingTo($argumentation)
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class FunctionalTester extends \Codeception\Actor {
|
||||
use _generated\FunctionalTesterActions;
|
||||
|
||||
public function loggedInAsActiveAccount() {
|
||||
$I = $this;
|
||||
$route = new LoginRoute($I);
|
||||
$route->login('Admin', 'password_0');
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->canSeeResponseJsonMatchesJsonPath('$.jwt');
|
||||
$jwt = $I->grabDataFromResponseByJsonPath('$.jwt')[0];
|
||||
$I->amBearerAuthenticated($jwt);
|
||||
}
|
||||
|
||||
public function notLoggedIn() {
|
||||
$this->haveHttpHeader('Authorization', null);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user