Skip to content

Commit d04c393

Browse files
Merge pull request #11936 from nextcloud/tests/fix-db-execute
test: fix usage of removed IQueryBuilder::execute
2 parents e40e483 + df4e9e5 commit d04c393

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/Integration/Service/DraftServiceIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace OCA\Mail\Tests\Integration\Service;
1111

1212
use ChristophWurst\Nextcloud\Testing\TestUser;
13-
use OC;
1413
use OCA\Mail\Account;
1514
use OCA\Mail\Contracts\IAttachmentService;
1615
use OCA\Mail\Contracts\IMailManager;
@@ -33,6 +32,7 @@
3332
use OCP\AppFramework\Utility\ITimeFactory;
3433
use OCP\EventDispatcher\IEventDispatcher;
3534
use OCP\Files\Folder;
35+
use OCP\IDBConnection;
3636
use OCP\IServerContainer;
3737
use OCP\IUser;
3838
use OCP\Server;
@@ -106,10 +106,10 @@ protected function setUp(): void {
106106
$this->accountService = $this->createMock(AccountService::class);
107107
$this->timeFactory = $this->createMock(ITimeFactory::class);
108108

109-
$db = OC::$server->getDatabaseConnection();
109+
$db = Server::get(IDBConnection::class);
110110
$qb = $db->getQueryBuilder();
111111
$delete = $qb->delete($this->mapper->getTableName());
112-
$delete->execute();
112+
$delete->executeStatement();
113113

114114
$this->service = new DraftsService(
115115
$this->transmission,

tests/Integration/Service/OutboxServiceIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
use ChristophWurst\Nextcloud\Testing\TestUser;
1313
use Horde_Imap_Client;
14-
use OC;
1514
use OCA\Mail\Account;
1615
use OCA\Mail\Contracts\IAttachmentService;
1716
use OCA\Mail\Contracts\IMailManager;
@@ -35,6 +34,7 @@
3534
use OCP\AppFramework\Utility\ITimeFactory;
3635
use OCP\EventDispatcher\IEventDispatcher;
3736
use OCP\Files\Folder;
37+
use OCP\IDBConnection;
3838
use OCP\IServerContainer;
3939
use OCP\IUser;
4040
use OCP\Server;
@@ -107,10 +107,10 @@ protected function setUp(): void {
107107
$this->timeFactory = Server::get(ITimeFactory::class);
108108
$this->chain = Server::get(Chain::class);
109109

110-
$this->db = OC::$server->getDatabaseConnection();
110+
$this->db = Server::get(IDBConnection::class);
111111
$qb = $this->db->getQueryBuilder();
112112
$delete = $qb->delete($this->mapper->getTableName());
113-
$delete->execute();
113+
$delete->executeStatement();
114114

115115
$this->outbox = new OutboxService(
116116
$this->mapper,

0 commit comments

Comments
 (0)