$this->clientMapper = new ClientMapper(\OC::$server->getDatabaseConnection());
}
+ protected function tearDown(): void {
+ $query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+ $query->delete('oauth2_clients')->execute();
+
+ parent::tearDown();
+ }
+
public function testGetByIdentifier() {
$client = new Client();
$client->setClientIdentifier('MyAwesomeClientIdentifier');
$this->assertEquals($client, $this->clientMapper->getByIdentifier('MyAwesomeClientIdentifier'));
}
-
public function testGetByIdentifierNotExisting() {
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);
$this->assertEquals($client, $this->clientMapper->getByUid($client->getId()));
}
-
public function testGetByUidNotExisting() {
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);