]> source.dussan.org Git - nextcloud-server.git/commitdiff
Clear leftover shares from other tests
authorVincent Petry <pvince81@owncloud.com>
Fri, 10 Apr 2015 11:43:57 +0000 (13:43 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 10 Apr 2015 12:53:17 +0000 (14:53 +0200)
apps/files_sharing/tests/deleteorphanedsharesjobtest.php

index 20f3bcd5ebd38575c8a81c55ec9fcdea76777b3b..8b5afcb9149356f272460ba056d60626e63f44b2 100644 (file)
@@ -70,6 +70,8 @@ class DeleteOrphanedSharesJobTest extends \Test\TestCase {
                parent::setUp();
 
                $this->connection = \OC::$server->getDatabaseConnection();
+               // clear occasional leftover shares from other tests
+               $this->connection->executeUpdate('DELETE FROM `*PREFIX*share`');
 
                $this->user1 = $this->getUniqueID('user1_');
                $this->user2 = $this->getUniqueID('user2_');
@@ -84,7 +86,7 @@ class DeleteOrphanedSharesJobTest extends \Test\TestCase {
        }
 
        protected function tearDown() {
-               $this->connection->executeUpdate('DELETE FROM `*PREFIX*share` WHERE `item_type` in (\'file\', \'folder\')');
+               $this->connection->executeUpdate('DELETE FROM `*PREFIX*share`');
 
                $userManager = \OC::$server->getUserManager();
                $user1 = $userManager->get($this->user1);