diff --git a/tests/Integration/Service/DraftServiceIntegrationTest.php b/tests/Integration/Service/DraftServiceIntegrationTest.php index 2439c40cfa..7453d2c633 100644 --- a/tests/Integration/Service/DraftServiceIntegrationTest.php +++ b/tests/Integration/Service/DraftServiceIntegrationTest.php @@ -10,7 +10,6 @@ namespace OCA\Mail\Tests\Integration\Service; use ChristophWurst\Nextcloud\Testing\TestUser; -use OC; use OCA\Mail\Account; use OCA\Mail\Contracts\IAttachmentService; use OCA\Mail\Contracts\IMailManager; @@ -33,6 +32,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Folder; +use OCP\IDBConnection; use OCP\IServerContainer; use OCP\IUser; use OCP\Server; @@ -106,10 +106,10 @@ protected function setUp(): void { $this->accountService = $this->createMock(AccountService::class); $this->timeFactory = $this->createMock(ITimeFactory::class); - $db = OC::$server->getDatabaseConnection(); + $db = Server::get(IDBConnection::class); $qb = $db->getQueryBuilder(); $delete = $qb->delete($this->mapper->getTableName()); - $delete->execute(); + $delete->executeStatement(); $this->service = new DraftsService( $this->transmission, diff --git a/tests/Integration/Service/OutboxServiceIntegrationTest.php b/tests/Integration/Service/OutboxServiceIntegrationTest.php index 6908f7911b..a55eed5d49 100644 --- a/tests/Integration/Service/OutboxServiceIntegrationTest.php +++ b/tests/Integration/Service/OutboxServiceIntegrationTest.php @@ -11,7 +11,6 @@ use ChristophWurst\Nextcloud\Testing\TestUser; use Horde_Imap_Client; -use OC; use OCA\Mail\Account; use OCA\Mail\Contracts\IAttachmentService; use OCA\Mail\Contracts\IMailManager; @@ -35,6 +34,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Folder; +use OCP\IDBConnection; use OCP\IServerContainer; use OCP\IUser; use OCP\Server; @@ -107,10 +107,10 @@ protected function setUp(): void { $this->timeFactory = Server::get(ITimeFactory::class); $this->chain = Server::get(Chain::class); - $this->db = OC::$server->getDatabaseConnection(); + $this->db = Server::get(IDBConnection::class); $qb = $this->db->getQueryBuilder(); $delete = $qb->delete($this->mapper->getTableName()); - $delete->execute(); + $delete->executeStatement(); $this->outbox = new OutboxService( $this->mapper,