]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make the test pass on repeating calls
authorJoas Schilling <coding@schilljs.com>
Fri, 6 Nov 2020 13:12:40 +0000 (14:12 +0100)
committerJoas Schilling <coding@schilljs.com>
Thu, 12 Nov 2020 11:57:51 +0000 (12:57 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/oauth2/tests/Db/ClientMapperTest.php

index ad1612da6b429996d830c166769d769085f87752..e4a71fc104057478f5cb3b0d5bf044b18b9012d4 100644 (file)
@@ -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);