AccountSessionFixture::class, ]; } public function testValidateRefreshToken() { $this->specify('error.refresh_token_not_exist if passed token not exists', function() { /** @var RefreshTokenForm $model */ $model = new class extends RefreshTokenForm { public function getSession() { return null; } }; $model->validateRefreshToken(); expect($model->getErrors('refresh_token'))->equals(['error.refresh_token_not_exist']); }); $this->specify('no errors if token exists', function() { /** @var RefreshTokenForm $model */ $model = new class extends RefreshTokenForm { public function getSession() { return new AccountSession(); } }; $model->validateRefreshToken(); expect($model->getErrors('refresh_token'))->isEmpty(); }); } public function testRenew() { $model = new RefreshTokenForm(); $model->refresh_token = $this->tester->grabFixture('sessions', 'admin')['refresh_token']; $this->assertInstanceOf(RenewResult::class, $model->renew()); } }