|
18 | 18 | use OCA\Maps\Service\PhotofilesService; |
19 | 19 | use OCP\DB\QueryBuilder\IQueryBuilder; |
20 | 20 | use OCP\IServerContainer; |
| 21 | +use OCP\Server; |
21 | 22 |
|
22 | 23 | class PhotosControllerTest extends \PHPUnit\Framework\TestCase { |
23 | 24 | private $appName; |
@@ -134,12 +135,12 @@ protected function setUp(): void { |
134 | 135 | $file->delete(); |
135 | 136 | } |
136 | 137 | // delete db |
137 | | - $qb = $c->query(IServerContainer::class)->query(\OCP\IDBConnection::class)->getQueryBuilder(); |
| 138 | + $qb = Server::get(\OCP\IDBConnection::class)->getQueryBuilder(); |
138 | 139 | $qb->delete('maps_photos') |
139 | 140 | ->where( |
140 | 141 | $qb->expr()->eq('user_id', $qb->createNamedParameter('test', IQueryBuilder::PARAM_STR)) |
141 | 142 | ); |
142 | | - $req = $qb->execute(); |
| 143 | + $req = $qb->executeStatement(); |
143 | 144 | } |
144 | 145 |
|
145 | 146 | public static function tearDownAfterClass(): void { |
@@ -351,13 +352,6 @@ public function testAddGetPhotos() { |
351 | 352 | $data = $resp->getData(); |
352 | 353 | $this->assertCount(1, $data); |
353 | 354 |
|
354 | | - //We do not clear the cache so we expect to still 1 photo |
355 | | - $resp = $this->photosController->getPhotos(); |
356 | | - $status = $resp->getStatus(); |
357 | | - $this->assertEquals(200, $status); |
358 | | - $data = $resp->getData(); |
359 | | - $this->assertCount(1, $data); |
360 | | - |
361 | 355 | //And we expect that there is still zero non Localized Photo |
362 | 356 | $resp = $this->photosController->getNonLocalizedPhotos(); |
363 | 357 | $status = $resp->getStatus(); |
|
0 commit comments