Make the test pass on repeating calls
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
e3b3ff6d43
commit
48c2f6d5a0
|
@ -40,6 +40,13 @@ class ClientMapperTest extends TestCase {
|
||||||
$this->clientMapper = new ClientMapper(\OC::$server->getDatabaseConnection());
|
$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() {
|
public function testGetByIdentifier() {
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
$client->setClientIdentifier('MyAwesomeClientIdentifier');
|
$client->setClientIdentifier('MyAwesomeClientIdentifier');
|
||||||
|
@ -51,7 +58,6 @@ class ClientMapperTest extends TestCase {
|
||||||
$this->assertEquals($client, $this->clientMapper->getByIdentifier('MyAwesomeClientIdentifier'));
|
$this->assertEquals($client, $this->clientMapper->getByIdentifier('MyAwesomeClientIdentifier'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testGetByIdentifierNotExisting() {
|
public function testGetByIdentifierNotExisting() {
|
||||||
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);
|
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);
|
||||||
|
|
||||||
|
@ -69,7 +75,6 @@ class ClientMapperTest extends TestCase {
|
||||||
$this->assertEquals($client, $this->clientMapper->getByUid($client->getId()));
|
$this->assertEquals($client, $this->clientMapper->getByUid($client->getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testGetByUidNotExisting() {
|
public function testGetByUidNotExisting() {
|
||||||
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);
|
$this->expectException(\OCA\OAuth2\Exceptions\ClientNotFoundException::class);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue