OauthAccessTokenFixture::class, ]; } public function testActionAccessTokens() { /** @var OauthAccessToken $validAccessToken */ $validAccessToken = $this->tester->grabFixture('accessTokens', 'admin-ely'); /** @var OauthAccessToken $expiredAccessToken */ $expiredAccessToken = $this->tester->grabFixture('accessTokens', 'admin-ely-expired'); $controller = new CleanupController('cleanup', Yii::$app); $this->assertEquals(0, $controller->actionAccessTokens()); $this->tester->canSeeRecord(OauthAccessToken::class, ['access_token' => $validAccessToken->access_token]); $this->tester->cantSeeRecord(OauthAccessToken::class, ['access_token' => $expiredAccessToken->access_token]); } }