Completed
Push — dev2 ( 764ed3...9e10b9 )
by Gordon
26:05 queued 17:34
created
tests/ElasticSearcherUnitTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 		// FIXME - this test appears fragile due to sharding issues with more like this
131 131
 		$ctr = 0;
132
-		if ($ctr < 9) {
132
+		if($ctr < 9) {
133 133
 			$this->assertStringStartsWith(
134 134
 				'[Texas and New Orleans, Southern Pacific',
135 135
 				$results[$ctr]->Title
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
 		$paginated = $es->search($query, $fields);
202 202
 		$ctr = 0;
203 203
 
204
-		foreach ($paginated->getList()->toArray() as $result) {
204
+		foreach($paginated->getList()->toArray() as $result) {
205 205
 			$ctr++;
206
-			foreach ($result->SearchHighlightsByField->Description_standard->getIterator() as $highlight) {
206
+			foreach($result->SearchHighlightsByField->Description_standard->getIterator() as $highlight) {
207 207
 				$snippet = $highlight->Snippet;
208 208
 				$snippet = strtolower($snippet);
209 209
 				$wordFound = false;
210 210
 				$lcquery = explode(' ', strtolower($query));
211
-				foreach ($lcquery as $part) {
211
+				foreach($lcquery as $part) {
212 212
 					$bracketed = '<strong class="hl">' . $part . '</strong>';
213
-					if (strpos($snippet, $bracketed) > 0) {
213
+					if(strpos($snippet, $bracketed) > 0) {
214 214
 						$wordFound = true;
215 215
 					}
216 216
 				}
@@ -230,17 +230,17 @@  discard block
 block discarded – undo
230 230
 		$paginated = $es->search($query, $fields);
231 231
 		$ctr = 0;
232 232
 
233
-		foreach ($paginated->getList()->toArray() as $result) {
233
+		foreach($paginated->getList()->toArray() as $result) {
234 234
 			$ctr++;
235 235
 
236
-			foreach ($result->SearchHighlightsByField->Description->getIterator() as $highlight) {
236
+			foreach($result->SearchHighlightsByField->Description->getIterator() as $highlight) {
237 237
 				$snippet = $highlight->Snippet;
238 238
 				$snippet = strtolower($snippet);
239 239
 				$wordFound = false;
240 240
 				$lcquery = explode(' ', strtolower($query));
241
-				foreach ($lcquery as $part) {
241
+				foreach($lcquery as $part) {
242 242
 					$bracketed = '<strong class="hl">' . $part . '</strong>';
243
-					if (strpos($snippet, $bracketed) > 0) {
243
+					if(strpos($snippet, $bracketed) > 0) {
244 244
 						$wordFound = true;
245 245
 					}
246 246
 				}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		$query = 'Lond';
258 258
 		$results = $es->autocomplete_search($query, 'Title');
259 259
 		$this->assertEquals(7, $results->getTotalItems());
260
-		foreach ($results->toArray() as $result) {
260
+		foreach($results->toArray() as $result) {
261 261
 			$this->assertTrue(strpos($result->Title, $query) > 0);
262 262
 		}
263 263
 	}
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		$results = $paginated->getList()->toArray();
268 268
 		$ctr = 0;
269 269
 		echo '$result = $paginated->getList()->toArray();' . "\n";
270
-		foreach ($results as $result) {
270
+		foreach($results as $result) {
271 271
 			echo '$this->assertEquals("' . $result->Title . '", $results[' . $ctr . ']->Title);' . "\n";
272 272
 			$ctr++;
273 273
 		}
Please login to merge, or discard this patch.