diff options
author | Robin Appelman <robin@icewind.nl> | 2021-05-26 15:50:35 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-06-14 16:11:40 +0200 |
commit | 66e10718c6109d0c02d603a5612fe4acc34c711f (patch) | |
tree | af1df42f12be833bbcdbc2e77035ed311ba0ae80 /tests | |
parent | f938daa6e4e37a7418a978926204e7fdec3b1640 (diff) | |
download | nextcloud-server-66e10718c6109d0c02d603a5612fe4acc34c711f.tar.gz nextcloud-server-66e10718c6109d0c02d603a5612fe4acc34c711f.zip |
split of query building bits from searchhelper
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Cache/SearchBuilderTest.php (renamed from tests/lib/Files/Cache/QuerySearchHelperTest.php) | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/tests/lib/Files/Cache/QuerySearchHelperTest.php b/tests/lib/Files/Cache/SearchBuilderTest.php index 46aa5a55493..82c4dbaa27f 100644 --- a/tests/lib/Files/Cache/QuerySearchHelperTest.php +++ b/tests/lib/Files/Cache/SearchBuilderTest.php @@ -22,33 +22,30 @@ namespace Test\Files\Cache; use OC\DB\QueryBuilder\Literal; -use OC\Files\Cache\QuerySearchHelper; +use OC\Files\Cache\SearchBuilder; use OC\Files\Search\SearchBinaryOperator; use OC\Files\Search\SearchComparison; -use OC\SystemConfig; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\IMimeTypeLoader; use OCP\Files\Search\ISearchBinaryOperator; use OCP\Files\Search\ISearchComparison; use OCP\Files\Search\ISearchOperator; -use OCP\IDBConnection; -use OCP\ILogger; use Test\TestCase; /** * @group DB */ -class QuerySearchHelperTest extends TestCase { - /** @var IQueryBuilder */ +class SearchBuilderTest extends TestCase { + /** @var IQueryBuilder */ private $builder; - /** @var IMimeTypeLoader|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IMimeTypeLoader|\PHPUnit\Framework\MockObject\MockObject */ private $mimetypeLoader; - /** @var QuerySearchHelper */ - private $querySearchHelper; + /** @var SearchBuilder */ + private $searchBuilder; - /** @var integer */ + /** @var integer */ private $numericStorageId; protected function setUp(): void { @@ -78,15 +75,7 @@ class QuerySearchHelperTest extends TestCase { [6, 'image'] ]); - $systemConfig = $this->createMock(SystemConfig::class); - $logger = $this->createMock(ILogger::class); - - $this->querySearchHelper = new QuerySearchHelper( - $this->mimetypeLoader, - \OC::$server->get(IDBConnection::class), - $systemConfig, - $logger - ); + $this->searchBuilder = new SearchBuilder($this->mimetypeLoader); $this->numericStorageId = 10000; $this->builder->select(['fileid']) @@ -145,7 +134,7 @@ class QuerySearchHelperTest extends TestCase { } private function search(ISearchOperator $operator) { - $dbOperator = $this->querySearchHelper->searchOperatorToDBExpr($this->builder, $operator); + $dbOperator = $this->searchBuilder->searchOperatorToDBExpr($this->builder, $operator); $this->builder->andWhere($dbOperator); $result = $this->builder->execute(); |