2016-02-24 04:04:01 +05:30
|
|
|
<?php
|
|
|
|
namespace tests\codeception\api\functional;
|
|
|
|
|
|
|
|
use Codeception\Specify;
|
2016-02-26 04:15:21 +05:30
|
|
|
use tests\codeception\api\_pages\AccountsRoute;
|
2016-02-24 04:04:01 +05:30
|
|
|
use tests\codeception\api\FunctionalTester;
|
|
|
|
|
2016-02-26 04:15:21 +05:30
|
|
|
class AccountsCurrentCest {
|
2016-02-24 04:04:01 +05:30
|
|
|
|
|
|
|
/**
|
2016-02-26 04:15:21 +05:30
|
|
|
* @var AccountsRoute
|
2016-02-24 04:04:01 +05:30
|
|
|
*/
|
|
|
|
private $route;
|
|
|
|
|
|
|
|
public function _before(FunctionalTester $I) {
|
2016-02-26 04:15:21 +05:30
|
|
|
$this->route = new AccountsRoute($I);
|
2016-02-24 04:04:01 +05:30
|
|
|
}
|
|
|
|
|
2016-05-10 17:37:32 +05:30
|
|
|
public function testCurrent(FunctionalTester $I) {
|
2016-02-24 04:04:01 +05:30
|
|
|
$I->loggedInAsActiveAccount();
|
|
|
|
|
|
|
|
$this->route->current();
|
|
|
|
$I->canSeeResponseCodeIs(200);
|
|
|
|
$I->canSeeResponseIsJson();
|
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'id' => 1,
|
|
|
|
'username' => 'Admin',
|
|
|
|
'email' => 'admin@ely.by',
|
2016-05-13 14:33:00 +05:30
|
|
|
'lang' => 'en',
|
2016-02-24 04:04:01 +05:30
|
|
|
'shouldChangePassword' => false,
|
2016-05-13 14:33:00 +05:30
|
|
|
'isActive' => true,
|
|
|
|
'hasMojangUsernameCollision' => false,
|
2016-02-24 04:04:01 +05:30
|
|
|
]);
|
2016-05-13 14:33:00 +05:30
|
|
|
$I->canSeeResponseJsonMatchesJsonPath('$.passwordChangedAt');
|
2016-02-24 04:04:01 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|