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