. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Localization\Locale\LocaleEnUs; use Fisharebest\Webtrees\TestCase; use Illuminate\Support\Collection; /** * 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], ['windsor']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchFamilyNames([$tree], ['charles', 'diana']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchIndividuals([$tree], ['windsor']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchIndividualNames([$tree], ['windsor']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchMedia([$tree], ['windsor']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchNotes([$tree], ['windsor']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchRepositories([$tree], ['national']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchSources([$tree], ['england']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchSourcesByName([$tree], ['england']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchSubmitters([$tree], ['greg']); $this->assertInstanceOf(Collection::class, $result); $result = $search_service->searchPlaces($tree, 'England'); $this->assertInstanceOf(Collection::class, $result); } }