Completed
Push — dev2 ( 9e10b9...bdf458 )
by Gordon
27:48 queued 10:02
created
tests/ElasticSearcherUnitTest.php 1 patch
Spacing   +13 added lines, -13 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
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
 		$paginated = $es->moreLikeThis($fp, $fields, true);
150 150
 		$results = $paginated->getList()->toArray();
151 151
 		$ctr = 0;
152
-		foreach ($results as $result) {
152
+		foreach($results as $result) {
153 153
 			$ctr++;
154
-			if ($ctr < 9) {
154
+			if($ctr < 9) {
155 155
 				$this->assertStringStartsWith(
156 156
 					'[Texas and New Orleans, Southern Pacific',
157 157
 					$result->Title
@@ -211,16 +211,16 @@  discard block
 block discarded – undo
211 211
 		$paginated = $es->search($query, $fields);
212 212
 		$ctr = 0;
213 213
 
214
-		foreach ($paginated->getList()->toArray() as $result) {
214
+		foreach($paginated->getList()->toArray() as $result) {
215 215
 			$ctr++;
216
-			foreach ($result->SearchHighlightsByField->Description_standard->getIterator() as $highlight) {
216
+			foreach($result->SearchHighlightsByField->Description_standard->getIterator() as $highlight) {
217 217
 				$snippet = $highlight->Snippet;
218 218
 				$snippet = strtolower($snippet);
219 219
 				$wordFound = false;
220 220
 				$lcquery = explode(' ', strtolower($query));
221
-				foreach ($lcquery as $part) {
221
+				foreach($lcquery as $part) {
222 222
 					$bracketed = '<strong class="hl">' . $part . '</strong>';
223
-					if (strpos($snippet, $bracketed) > 0) {
223
+					if(strpos($snippet, $bracketed) > 0) {
224 224
 						$wordFound = true;
225 225
 					}
226 226
 				}
@@ -240,17 +240,17 @@  discard block
 block discarded – undo
240 240
 		$paginated = $es->search($query, $fields);
241 241
 		$ctr = 0;
242 242
 
243
-		foreach ($paginated->getList()->toArray() as $result) {
243
+		foreach($paginated->getList()->toArray() as $result) {
244 244
 			$ctr++;
245 245
 
246
-			foreach ($result->SearchHighlightsByField->Description->getIterator() as $highlight) {
246
+			foreach($result->SearchHighlightsByField->Description->getIterator() as $highlight) {
247 247
 				$snippet = $highlight->Snippet;
248 248
 				$snippet = strtolower($snippet);
249 249
 				$wordFound = false;
250 250
 				$lcquery = explode(' ', strtolower($query));
251
-				foreach ($lcquery as $part) {
251
+				foreach($lcquery as $part) {
252 252
 					$bracketed = '<strong class="hl">' . $part . '</strong>';
253
-					if (strpos($snippet, $bracketed) > 0) {
253
+					if(strpos($snippet, $bracketed) > 0) {
254 254
 						$wordFound = true;
255 255
 					}
256 256
 				}
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		$query = 'Lond';
268 268
 		$results = $es->autocomplete_search($query, 'Title');
269 269
 		$this->assertEquals(7, $results->getTotalItems());
270
-		foreach ($results->toArray() as $result) {
270
+		foreach($results->toArray() as $result) {
271 271
 			$this->assertTrue(strpos($result->Title, $query) > 0);
272 272
 		}
273 273
 	}
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 		$results = $paginated->getList()->toArray();
278 278
 		$ctr = 0;
279 279
 		echo '$result = $paginated->getList()->toArray();' . "\n";
280
-		foreach ($results as $result) {
280
+		foreach($results as $result) {
281 281
 			echo '$this->assertEquals("' . $result->Title . '", $results[' . $ctr . ']->Title);' . "\n";
282 282
 			$ctr++;
283 283
 		}
Please login to merge, or discard this patch.