. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Localization\Locale\LocaleEnUs; use Fisharebest\Webtrees\TestCase; use Illuminate\Support\Collection; use Mockery; /** * Test harness for the class SearchService * * @covers \Fisharebest\Webtrees\Services\SearchService */ class SearchServiceTest extends TestCase { protected static $uses_database = true; /** * @return void */ public function testSearchesReturnCollections(): void { $search_service = new SearchService(new LocaleEnUs()); $tree = $this->importTree('demo.ged'); $result = $search_service->searchFamilies([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchFamilyNames([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchIndividuals([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchIndividualNames([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchMedia([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchNotes([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchRepositories([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchSourcesByName([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchSubmitters([$tree], ['foo']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchPlaces($tree, 'foo'); $this->assertInstanceOf(Collection::class, $result); } }