Fix RepairMimeTypeTest

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-08-09 16:04:57 +02:00
parent db27bbf90d
commit 26bf0ca9d4
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -54,16 +54,22 @@ class RepairMimeTypesTest extends \Test\TestCase {
protected function tearDown() {
$this->storage->getCache()->clear();
$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
\OC_DB::executeAudited($sql, [$this->storage->getId()]);
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$qb->delete('storages')
->where($qb->expr()->eq('id', $qb->createNamedParameter($this->storage->getId())));
$qb->execute();
$this->clearMimeTypes();
parent::tearDown();
}
private function clearMimeTypes() {
$sql = 'DELETE FROM `*PREFIX*mimetypes`';
\OC_DB::executeAudited($sql);
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$qb->delete('mimetypes');
$qb->execute();
$this->mimetypeLoader->reset();
}