|
@@ 99-116 (lines=18) @@
|
| 96 |
|
* |
| 97 |
|
* @depends testFindContentInfoFullTextIsSearchable |
| 98 |
|
*/ |
| 99 |
|
public function testFindContentInfoFullTextIsNotSearchable() |
| 100 |
|
{ |
| 101 |
|
$searchTerm = 'pamplemousse'; |
| 102 |
|
$this->createFullTextIsSearchableContent($searchTerm, false); |
| 103 |
|
|
| 104 |
|
$repository = $this->getRepository(); |
| 105 |
|
$searchService = $repository->getSearchService(); |
| 106 |
|
|
| 107 |
|
$query = new Query( |
| 108 |
|
[ |
| 109 |
|
'query' => new Criterion\FullText($searchTerm), |
| 110 |
|
] |
| 111 |
|
); |
| 112 |
|
|
| 113 |
|
$searchResult = $searchService->findContentInfo($query); |
| 114 |
|
|
| 115 |
|
$this->assertEquals(0, $searchResult->totalCount); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
/** |
| 119 |
|
* Test that indexing full text data depends on the isSearchable flag on the field definition. |
|
@@ 123-139 (lines=17) @@
|
| 120 |
|
* |
| 121 |
|
* @depends testFindLocationsFullTextIsSearchable |
| 122 |
|
*/ |
| 123 |
|
public function testFindLocationsFullTextIsNotSearchable() |
| 124 |
|
{ |
| 125 |
|
$searchTerm = 'pamplemousse'; |
| 126 |
|
|
| 127 |
|
$repository = $this->getRepository(false); |
| 128 |
|
$searchService = $repository->getSearchService(); |
| 129 |
|
|
| 130 |
|
$query = new LocationQuery( |
| 131 |
|
[ |
| 132 |
|
'query' => new Criterion\FullText($searchTerm), |
| 133 |
|
] |
| 134 |
|
); |
| 135 |
|
|
| 136 |
|
$searchResult = $searchService->findLocations($query); |
| 137 |
|
|
| 138 |
|
$this->assertEquals(0, $searchResult->totalCount); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
/** |
| 142 |
|
* Creates Content for testing full text search depending on the isSearchable flag. |