diff --git a/composer.json b/composer.json index 4efcad6..7eb1737 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "php": "^8.1" }, "require-dev": { - "nextcloud/ocp": "dev-stable29", + "nextcloud/ocp": "dev-stable30", "roave/security-advisories": "dev-latest" }, "config": { diff --git a/composer.lock b/composer.lock index abed015..32fead6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ff15934a01c460254ce07e8ba9f3384f", + "content-hash": "e2995a6b4206f96eebea34e60c231cac", "packages": [ { "name": "bamarni/composer-bin-plugin", @@ -67,16 +67,16 @@ "packages-dev": [ { "name": "nextcloud/ocp", - "version": "dev-stable29", + "version": "dev-stable30", "source": { "type": "git", "url": "https://github.com/nextcloud-deps/ocp.git", - "reference": "b130f11ce24351a6a91115aa6f386271f7aeee9d" + "reference": "fddf605cdc7cd9b3b020ea40f6f0a6331127dc12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/b130f11ce24351a6a91115aa6f386271f7aeee9d", - "reference": "b130f11ce24351a6a91115aa6f386271f7aeee9d", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/fddf605cdc7cd9b3b020ea40f6f0a6331127dc12", + "reference": "fddf605cdc7cd9b3b020ea40f6f0a6331127dc12", "shasum": "" }, "require": { @@ -89,7 +89,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-stable29": "29.0.0-dev" + "dev-stable30": "30.0.0-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -105,9 +105,9 @@ "description": "Composer package containing Nextcloud's public API (classes, interfaces)", "support": { "issues": "https://github.com/nextcloud-deps/ocp/issues", - "source": "https://github.com/nextcloud-deps/ocp/tree/stable29" + "source": "https://github.com/nextcloud-deps/ocp/tree/stable30" }, - "time": "2024-09-05T00:40:09+00:00" + "time": "2024-10-03T00:42:50+00:00" }, { "name": "psr/clock", @@ -316,12 +316,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "ed0688c3e18bf76d2a17fb243b99acb52c2e29ef" + "reference": "6fc16d8c05a872bf86eb0a1684d89b9bcb93d636" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/ed0688c3e18bf76d2a17fb243b99acb52c2e29ef", - "reference": "ed0688c3e18bf76d2a17fb243b99acb52c2e29ef", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6fc16d8c05a872bf86eb0a1684d89b9bcb93d636", + "reference": "6fc16d8c05a872bf86eb0a1684d89b9bcb93d636", "shasum": "" }, "conflict": { @@ -332,7 +332,7 @@ "aimeos/ai-admin-graphql": ">=2022.04.1,<2022.10.10|>=2023.04.1,<2023.10.6|>=2024.04.1,<2024.04.6", "aimeos/ai-admin-jsonadm": "<2020.10.13|>=2021.04.1,<2021.10.6|>=2022.04.1,<2022.10.3|>=2023.04.1,<2023.10.4|==2024.04.1", "aimeos/ai-client-html": ">=2020.04.1,<2020.10.27|>=2021.04.1,<2021.10.22|>=2022.04.1,<2022.10.13|>=2023.04.1,<2023.10.15|>=2024.04.1,<2024.04.7", - "aimeos/ai-controller-frontend": "<2020.10.15|>=2021.04.1,<2021.10.8|>=2022.04.1,<2022.10.8|>=2023.04.1,<2023.10.9", + "aimeos/ai-controller-frontend": "<2020.10.15|>=2021.04.1,<2021.10.8|>=2022.04.1,<2022.10.8|>=2023.04.1,<2023.10.9|==2024.04.1", "aimeos/aimeos-core": ">=2022.04.1,<2022.10.17|>=2023.04.1,<2023.10.17|>=2024.04.1,<2024.04.7", "aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5", "airesvsg/acf-to-rest-api": "<=3.1", @@ -418,13 +418,13 @@ "codeigniter4/shield": "<1.0.0.0-beta8", "codiad/codiad": "<=2.8.4", "composer/composer": "<1.10.27|>=2,<2.2.24|>=2.3,<2.7.7", - "concrete5/concrete5": "<9.3.3", + "concrete5/concrete5": "<9.3.4", "concrete5/core": "<8.5.8|>=9,<9.1", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/comments-bundle": ">=2,<4.13.40|>=5.0.0.0-RC1-dev,<5.3.4", - "contao/contao": ">=3,<3.5.37|>=4,<4.4.56|>=4.5,<4.9.40|>=4.10,<4.11.7|>=4.13,<4.13.21|>=5.1,<5.1.4", + "contao/contao": "<=5.4.1", "contao/core": "<3.5.39", - "contao/core-bundle": "<4.13.40|>=5,<5.3.4", + "contao/core-bundle": "<4.13.49|>=5,<5.3.15|>=5.4,<5.4.3", "contao/listing-bundle": ">=3,<=3.5.30|>=4,<4.4.8", "contao/managed-edition": "<=1.5", "corveda/phpsandbox": "<1.3.5", @@ -432,8 +432,9 @@ "craftcms/cms": "<4.6.2|>=5,<=5.2.2", "croogo/croogo": "<4", "cuyz/valinor": "<0.12", + "czim/file-handling": "<1.5|>=2,<2.3", "czproject/git-php": "<4.0.3", - "damienharper/auditor-bundle": "<6", + "damienharper/auditor-bundle": "<5.2.6", "dapphp/securimage": "<3.6.6", "darylldoyle/safe-svg": "<1.9.10", "datadog/dd-trace": ">=0.30,<0.30.2", @@ -444,6 +445,7 @@ "derhansen/fe_change_pwd": "<2.0.5|>=3,<3.0.3", "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1|>=7,<7.4", "desperado/xml-bundle": "<=0.1.7", + "dev-lancer/minecraft-motd-parser": "<=1.0.5", "devgroup/dotplant": "<2020.09.14-dev", "directmailteam/direct-mail": "<6.0.3|>=7,<7.0.3|>=8,<9.5.2", "doctrine/annotations": "<1.2.7", @@ -458,9 +460,9 @@ "dolibarr/dolibarr": "<19.0.2", "dompdf/dompdf": "<2.0.4", "doublethreedigital/guest-entries": "<3.1.2", - "drupal/core": ">=6,<6.38|>=7,<7.96|>=8,<10.1.8|>=10.2,<10.2.2|==11.9999999.9999999.9999999-dev", - "drupal/core-recommended": "==11.9999999.9999999.9999999-dev", - "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4|==11.9999999.9999999.9999999-dev", + "drupal/core": ">=6,<6.38|>=7,<7.96|>=8,<10.2.9|>=10.3,<10.3.6|>=11,<11.0.5", + "drupal/core-recommended": ">=8,<10.2.9|>=10.3,<10.3.6|>=11,<11.0.5", + "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.80|>=8,<10.2.9|>=10.3,<10.3.6|>=11,<11.0.5", "duncanmcclean/guest-entries": "<3.1.2", "dweeves/magmi": "<=0.7.24", "ec-cube/ec-cube": "<2.4.4|>=2.11,<=2.17.1|>=3,<=3.0.18.0-patch4|>=4,<=4.1.2", @@ -503,6 +505,8 @@ "feehi/cms": "<=2.1.1", "feehi/feehicms": "<=2.1.1", "fenom/fenom": "<=2.12.1", + "filament/infolists": ">=3,<3.2.115", + "filament/tables": ">=3,<3.2.115", "filegator/filegator": "<7.8", "filp/whoops": "<2.1.13", "fineuploader/php-traditional-server": "<=1.2.2", @@ -589,7 +593,7 @@ "in2code/femanager": "<5.5.3|>=6,<6.3.4|>=7,<7.2.3", "in2code/ipandlanguageredirect": "<5.1.2", "in2code/lux": "<17.6.1|>=18,<24.0.2", - "in2code/powermail": "<7.5|>=8,<8.5|>=9,<10.9|>=11,<12.4", + "in2code/powermail": "<7.5.1|>=8,<8.5.1|>=9,<10.9.1|>=11,<12.4.1", "innologi/typo3-appointments": "<2.0.6", "intelliants/subrion": "<4.2.2", "inter-mediator/inter-mediator": "==5.5", @@ -619,18 +623,20 @@ "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", "khodakhah/nodcms": "<=3", - "kimai/kimai": "<2.16", + "kimai/kimai": "<=2.20.1", "kitodo/presentation": "<3.2.3|>=3.3,<3.3.4", "klaviyo/magento2-extension": ">=1,<3", "knplabs/knp-snappy": "<=1.4.2", "kohana/core": "<3.3.3", - "krayin/laravel-crm": "<1.2.2", + "krayin/laravel-crm": "<=1.3", "kreait/firebase-php": ">=3.2,<3.8.1", "kumbiaphp/kumbiapp": "<=1.1.1", "la-haute-societe/tcpdf": "<6.2.22", "laminas/laminas-diactoros": "<2.18.1|==2.19|==2.20|==2.21|==2.22|==2.23|>=2.24,<2.24.2|>=2.25,<2.25.2", "laminas/laminas-form": "<2.17.1|>=3,<3.0.2|>=3.1,<3.1.1", "laminas/laminas-http": "<2.14.2", + "lara-zeus/artemis": ">=1,<=1.0.6", + "lara-zeus/dynamic-dashboard": ">=3,<=3.0.1", "laravel/fortify": "<1.11.1", "laravel/framework": "<6.20.44|>=7,<7.30.6|>=8,<8.75", "laravel/laravel": ">=5.4,<5.4.22", @@ -646,13 +652,13 @@ "librenms/librenms": "<2017.08.18", "liftkit/database": "<2.13.2", "lightsaml/lightsaml": "<1.3.5", - "limesurvey/limesurvey": "<3.27.19", + "limesurvey/limesurvey": "<6.5.12", "livehelperchat/livehelperchat": "<=3.91", - "livewire/livewire": ">2.2.4,<2.2.6|>=3.3.5,<3.4.9", + "livewire/livewire": "<2.12.7|>=3.0.0.0-beta1,<3.5.2", "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", "luyadev/yii-helpers": "<1.2.1", - "magento/community-edition": "<2.4.5|==2.4.5|>=2.4.5.0-patch1,<2.4.5.0-patch8|==2.4.6|>=2.4.6.0-patch1,<2.4.6.0-patch6|==2.4.7", + "magento/community-edition": "<2.4.5|==2.4.5|>=2.4.5.0-patch1,<2.4.5.0-patch9|==2.4.6|>=2.4.6.0-patch1,<2.4.6.0-patch7|==2.4.7|>=2.4.7.0-patch1,<2.4.7.0-patch2", "magento/core": "<=1.9.4.5", "magento/magento1ce": "<1.9.4.3-dev", "magento/magento1ee": ">=1,<1.14.4.3-dev", @@ -660,11 +666,13 @@ "magneto/core": "<1.9.4.4-dev", "maikuolan/phpmussel": ">=1,<1.6", "mainwp/mainwp": "<=4.4.3.3", - "mantisbt/mantisbt": "<2.26.2", + "mantisbt/mantisbt": "<=2.26.3", "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", - "mautic/core": "<4.4.12|>=5.0.0.0-alpha,<5.0.4", + "mautic/core": "<4.4.13|>=5,<5.1.1", + "mautic/core-lib": ">=1.0.0.0-beta,<4.4.13|>=5.0.0.0-alpha,<5.1.1", "mdanter/ecc": "<2", + "mediawiki/cargo": "<3.6.1", "mediawiki/core": "<1.36.2", "mediawiki/matomo": "<2.4.3", "mediawiki/semantic-media-wiki": "<4.0.2", @@ -721,7 +729,7 @@ "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", "october/backend": "<1.1.2", "october/cms": "<1.0.469|==1.0.469|==1.0.471|==1.1.1", - "october/october": "<=3.4.4", + "october/october": "<=3.6.4", "october/rain": "<1.0.472|>=1.1,<1.1.2", "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.5.15", "omeka/omeka-s": "<4.0.3", @@ -773,7 +781,7 @@ "phpmyfaq/phpmyfaq": "<3.2.5|==3.2.5", "phpoffice/common": "<0.2.9", "phpoffice/phpexcel": "<1.8", - "phpoffice/phpspreadsheet": "<1.29.1|>=2,<2.2.1", + "phpoffice/phpspreadsheet": "<1.29.2|>=2,<2.1.1|>=2.2,<2.3", "phpseclib/phpseclib": "<2.0.47|>=3,<3.0.36", "phpservermon/phpservermon": "<3.6", "phpsysinfo/phpsysinfo": "<3.4.3", @@ -816,7 +824,7 @@ "pubnub/pubnub": "<6.1", "pusher/pusher-php-server": "<2.2.1", "pwweb/laravel-core": "<=0.3.6.0-beta", - "pxlrbt/filament-excel": "<2.3.3", + "pxlrbt/filament-excel": "<1.1.14|>=2.0.0.0-alpha,<2.3.3", "pyrocms/pyrocms": "<=3.9.1", "qcubed/qcubed": "<=3.1.1", "quickapps/cms": "<=2.0.0.0-beta2", @@ -893,6 +901,7 @@ "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "ssddanbrown/bookstack": "<24.05.1", + "starcitizentools/citizen-skin": ">=2.6.3,<2.31", "statamic/cms": "<4.46|>=5.3,<5.6.2", "stormpath/sdk": "<9.9.99", "studio-42/elfinder": "<=2.1.64", @@ -900,7 +909,7 @@ "subhh/libconnect": "<7.0.8|>=8,<8.1", "sukohi/surpass": "<1", "sulu/form-bundle": ">=2,<2.5.3", - "sulu/sulu": "<1.6.44|>=2,<2.4.17|>=2.5,<2.5.13", + "sulu/sulu": "<1.6.44|>=2,<2.6.5", "sumocoders/framework-user-bundle": "<1.4", "superbig/craft-audit": "<3.0.2", "swag/paypal": "<5.4.4", @@ -972,13 +981,13 @@ "topthink/thinkphp": "<=3.2.3", "torrentpier/torrentpier": "<=2.4.3", "tpwd/ke_search": "<4.0.3|>=4.1,<4.6.6|>=5,<5.0.2", - "tribalsystems/zenario": "<9.5.60602", + "tribalsystems/zenario": "<=9.7.61188", "truckersmp/phpwhois": "<=4.3.1", "ttskch/pagination-service-provider": "<1", "twbs/bootstrap": "<=3.4.1|>=4,<=4.6.2", "twig/twig": "<1.44.8|>=2,<2.16.1|>=3,<3.11.1|>=3.12,<3.14", "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", - "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<10.4.46|>=11,<11.5.40|>=12,<12.4.21|>=13,<13.3.1", "typo3/cms-core": "<=8.7.56|>=9,<=9.5.47|>=10,<=10.4.44|>=11,<=11.5.36|>=12,<=12.4.14|>=13,<=13.1", "typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1", "typo3/cms-fluid": "<4.3.4|>=4.4,<4.4.1", @@ -1028,6 +1037,7 @@ "winter/wn-dusk-plugin": "<2.1", "winter/wn-system-module": "<1.2.4", "wintercms/winter": "<=1.2.3", + "wireui/wireui": "<1.19.3|>=2,<2.1.3", "woocommerce/woocommerce": "<6.6|>=8.8,<8.8.5|>=8.9,<8.9.3", "wp-cli/wp-cli": ">=0.12,<2.5", "wp-graphql/wp-graphql": "<=1.14.5", @@ -1130,7 +1140,7 @@ "type": "tidelift" } ], - "time": "2024-09-10T18:06:22+00:00" + "time": "2024-10-10T00:18:21+00:00" } ], "aliases": [], @@ -1148,5 +1158,5 @@ "platform-overrides": { "php": "8.1" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 7ef8a94..5d8c9c7 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -9,9 +9,12 @@ namespace OCA\NcTheming\AppInfo; +use OC\AppFramework\Bootstrap\Coordinator; use OC\AppFramework\DependencyInjection\DIContainer; +use OC\Search\SearchComposer; use OCA\NcTheming\Service\OverrideThemesService; use OCA\NcTheming\Themes\OverrideDefaultTheme; +use OCA\NcTheming\Search\SearchComposerDecorator; use OCA\Theming\Service\ThemesService; use OCA\Theming\Themes\DarkHighContrastTheme; use OCA\Theming\Themes\DarkTheme; @@ -25,12 +28,18 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\AppFramework\QueryException; use OCP\IConfig; +use OCP\IURLGenerator; use OCP\IUserSession; +use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; class Application extends App implements IBootstrap { public const APP_ID = 'nc_theming'; + public const ALLOWED_SEARCH_PROVIDERS = [ + 'files', + ]; + /** @psalm-suppress PossiblyUnusedMethod */ public function __construct() { parent::__construct(self::APP_ID); @@ -74,8 +83,32 @@ public function register(IRegistrationContext $context): void { $c->get(DyslexiaFont::class) ); }); + + // allow only desired search providers for full-text search + $this->registerSearchComposerDecorator($context); } public function boot(IBootContext $context): void { } + + /** + * Decorate SearchComposer with allowed search providers - + * to ensure being listed and used for searches + * + * For allow list, the ids of the Search\IProvider is used + */ + protected function registerSearchComposerDecorator(IRegistrationContext $context) { + $this->getContainer()->getServer()->registerService(SearchComposer::class, + function ($c) { + return new SearchComposerDecorator( + new SearchComposer( + $c->get(Coordinator::class), + $c->get(ContainerInterface::class), + $c->get(IURLGenerator::class), + $c->get(LoggerInterface::class) + ), + self::ALLOWED_SEARCH_PROVIDERS + ); + }); + } } diff --git a/lib/Search/SearchComposerDecorator.php b/lib/Search/SearchComposerDecorator.php new file mode 100644 index 0000000..fcc8028 --- /dev/null +++ b/lib/Search/SearchComposerDecorator.php @@ -0,0 +1,63 @@ +decorated = $decorated; + $this->allowedProviderIds = $allowedProviderIds; + } + + /** + * Get providers from allowed provider list + */ + public function getProviders(string $route, array $routeParameters): array { + $providers = $this->decorated->getProviders($route, $routeParameters); + + if (empty($this->allowedProviderIds)) { + return $providers; + } + + return array_values(array_filter($providers, function ($p) { + return in_array($p['id'], $this->allowedProviderIds); + })); + } + + /** + * No decoration, only delegate. + */ + public function search(IUser $user, string $providerId, ISearchQuery $query): SearchResult { + return $this->decorated->search($user, $providerId, $query); + } + + /** + * No decoration, only delegate. + */ + public function buildFilterList(string $providerId, array $parameters): FilterCollection { + return $this->decorated->buildFilterList($providerId, $parameters); + } +} diff --git a/tests/unit/AppInfo/ApplicationTest.php b/tests/unit/AppInfo/ApplicationTest.php index 875ecde..1457609 100644 --- a/tests/unit/AppInfo/ApplicationTest.php +++ b/tests/unit/AppInfo/ApplicationTest.php @@ -31,6 +31,13 @@ protected function setUp(): void { $this->app->register($coordinator->getRegistrationContext()->for('nc_theming')); $this->context = $this->createMock(IRegistrationContext::class); + + $this->serverOriginal = \OC::$server; + } + + protected function tearDown(): void { + parent::tearDown(); + \OC::$server = $this->serverOriginal; } public function testThemingOverrideRegistration(): void { diff --git a/tests/unit/Search/SearchComposerDecoratorTest.php b/tests/unit/Search/SearchComposerDecoratorTest.php new file mode 100644 index 0000000..18c7b3c --- /dev/null +++ b/tests/unit/Search/SearchComposerDecoratorTest.php @@ -0,0 +1,129 @@ +app = new \OCP\AppFramework\App(Application::APP_ID); + } + + public function testGetProvidersDefault() { + $this->composerService = + new SearchComposerDecorator( + new SearchComposer( + $this->app->getContainer()->get(Coordinator::class), + $this->app->getContainer()->get(ContainerInterface::class), + $this->app->getContainer()->get(IURLGenerator::class), + $this->app->getContainer()->get(LoggerInterface::class) + ), + [ + ] + ); + $providers = array_values($this->composerService->getProviders('/', [])); + $providerIds = array_map(function ($p) { + return $p['id']; + }, $providers); + + $this->assertContains('files', $providerIds); + $this->assertContains('systemtags', $providerIds); + $this->assertContains('comments', $providerIds); + $this->assertContains('settings_apps', $providerIds); + $this->assertContains('settings', $providerIds); + } + + public function testGetProvidersAllowed() { + $this->composerService = + new SearchComposerDecorator( + new SearchComposer( + $this->app->getContainer()->get(Coordinator::class), + $this->app->getContainer()->get(ContainerInterface::class), + $this->app->getContainer()->get(IURLGenerator::class), + $this->app->getContainer()->get(LoggerInterface::class) + ), + [ + 'files', + 'settings', + ] + ); + $providers = array_values($this->composerService->getProviders('/', [])); + $providerIds = array_map(function ($p) { + return $p['id']; + }, $providers); + $this->assertContains('settings', $providerIds); + $this->assertContains('files', $providerIds); + $this->assertNotContains('settings_apps', $providerIds); + $this->assertNotContains('systemtags', $providerIds); + } + + protected function createSearchMock(): void { + $this->decoratedSearchComposer = $this->createMock(SearchComposer::class); + $this->composerService = + new SearchComposerDecorator( + $this->decoratedSearchComposer, + [ + 'files', + 'settings', + ] + ); + + $this->user = $this->createMock(IUser::class); + $this->query = $this->createMock(ISearchQuery::class); + } + + public function testSearchDisabledProvider() { + $this->createSearchMock(); + /** @var ISearchResult $searchResult */ + $searchResult = SearchResult::complete('files', []); + $this->decoratedSearchComposer->expects(self::once()) + ->method('search') + ->with($this->user, 'files', $this->query) + ->willReturn($searchResult); + + $result = $this->composerService->search($this->user, 'files', $this->query)->jsonSerialize(); + + $this->assertEquals('files', $result['name']); + $this->assertFalse($result['isPaginated']); + $this->assertEmpty($result['entries']); + } + + public function testSearch() { + $this->createSearchMock(); + $this->decoratedSearchComposer->expects(self::once()) + ->method("search") + ->with($this->equalTo($this->user), $this->equalTo('files'), $this->equalTo($this->query)) + ->willReturn(SearchResult::complete('files', [])); + $this->composerService->search($this->user, 'files', $this->query)->jsonSerialize(); + } +}