Make the test pass on repeating calls

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/23882/head
Joas Schilling 4 years ago
parent 61c767128c
commit 39131519b2
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
  1. 9
      apps/oauth2/tests/Db/ClientMapperTest.php

@ -40,6 +40,13 @@ class ClientMapperTest extends TestCase {
$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');
@ -51,7 +58,6 @@ class ClientMapperTest extends TestCase {
$this->assertEquals($client, $this->clientMapper->getByIdentifier('MyAwesomeClientIdentifier'));
}
public function testGetByIdentifierNotExisting() {
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);
@ -69,7 +75,6 @@ class ClientMapperTest extends TestCase {
$this->assertEquals($client, $this->clientMapper->getByUid($client->getId()));
}
public function testGetByUidNotExisting() {
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);

Loading…
Cancel
Save