route = new AccountsRoute($I); } public function testBanAccount(OauthSteps $I) { $accessToken = $I->getAccessTokenByClientCredentialsGrant([P::BLOCK_ACCOUNT]); $I->amBearerAuthenticated($accessToken); $this->route->ban(1); $I->canSeeResponseCodeIs(200); $I->canSeeResponseIsJson(); $I->canSeeResponseContainsJson([ 'success' => true, ]); } public function testBanBannedAccount(OauthSteps $I) { $accessToken = $I->getAccessTokenByClientCredentialsGrant([P::BLOCK_ACCOUNT]); $I->amBearerAuthenticated($accessToken); $this->route->ban(10); $I->canSeeResponseCodeIs(200); $I->canSeeResponseIsJson(); $I->canSeeResponseContainsJson([ 'success' => false, 'errors' => [ 'account' => 'error.account_already_banned', ], ]); } }