Completed
Push — dev2 ( 43abef...06e018 )
by Gordon
31:15 queued 16:24
created
tests/ElasticSearchPageControllerTest.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 		$this->assertEquals(200, $searchPage->getStatusCode());
75 75
 		$url = rtrim($url, '/');
76 76
 
77
-        $response = $this->get($url);
78
-        error_log(print_r($response,1));
79
-        $this->assertEquals(200, $response->getStatusCode());
77
+		$response = $this->get($url);
78
+		error_log(print_r($response,1));
79
+		$this->assertEquals(200, $response->getStatusCode());
80 80
 
81
-        $this->assertSelectorStartsWithOrEquals('span.count', 0, '(5)');
81
+		$this->assertSelectorStartsWithOrEquals('span.count', 0, '(5)');
82 82
 		$this->assertSelectorStartsWithOrEquals('span.count', 1, '(11)');
83 83
 		$this->assertSelectorStartsWithOrEquals('span.count', 2, '(12)');
84 84
 		$this->assertSelectorStartsWithOrEquals('span.count', 3, '(13)');
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 		$url = rtrim($url, '/');
129 129
 		$url .= '?ISO=400';
130 130
 
131
-        $response = $this->get($url);
132
-        error_log(print_r($response,1));
133
-        $this->assertEquals(200, $response->getStatusCode());
131
+		$response = $this->get($url);
132
+		error_log(print_r($response,1));
133
+		$this->assertEquals(200, $response->getStatusCode());
134 134
 
135
-        // These are less than in the no facets selected case, as expected
135
+		// These are less than in the no facets selected case, as expected
136 136
 		$this->assertSelectorStartsWithOrEquals('span.count', 0, '(2)');
137 137
 		$this->assertSelectorStartsWithOrEquals('span.count', 1, '(1)');
138 138
 		$this->assertSelectorStartsWithOrEquals('span.count', 2, '(2)');
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 		$url = rtrim($url, '/');
177 177
 		$url .= '?ISO=400&ShutterSpeed=2%2F250';
178 178
 
179
-        $response = $this->get($url);
180
-        error_log(print_r($response,1));
181
-        $this->assertEquals(200, $response->getStatusCode());
179
+		$response = $this->get($url);
180
+		error_log(print_r($response,1));
181
+		$this->assertEquals(200, $response->getStatusCode());
182 182
 
183
-        // These are less than in the one facet selected case, as expected
184
-        $this->assertSelectorStartsWithOrEquals('span.count', 0, '(1)');
183
+		// These are less than in the one facet selected case, as expected
184
+		$this->assertSelectorStartsWithOrEquals('span.count', 0, '(1)');
185 185
 		$this->assertSelectorStartsWithOrEquals('span.count', 1, '(2)');
186 186
 		$this->assertSelectorStartsWithOrEquals('span.count', 2, '(1)');
187 187
 		$this->assertSelectorStartsWithOrEquals('span.count', 3, '(1)');
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
 		$url = rtrim($url, '/');
211 211
 		$url .= '?ISO=400&ShutterSpeed=2%2F250&Aspect=Vertical';
212 212
 
213
-        $response = $this->get($url);
214
-        $this->assertEquals(200, $response->getStatusCode());
213
+		$response = $this->get($url);
214
+		$this->assertEquals(200, $response->getStatusCode());
215 215
 
216
-        // These are less than in the one facet selected case, as expected
217
-        $this->assertSelectorStartsWithOrEquals('span.count', 0, '(2)');
216
+		// These are less than in the one facet selected case, as expected
217
+		$this->assertSelectorStartsWithOrEquals('span.count', 0, '(2)');
218 218
 		$this->assertSelectorStartsWithOrEquals('span.count', 1, '(1)');
219 219
 		$this->assertSelectorStartsWithOrEquals('span.count', 2, '(1)');
220 220
 	}
@@ -551,13 +551,13 @@  discard block
 block discarded – undo
551 551
 		$searchPage = $this->get($searchPageObj->URLSegment);
552 552
 		$this->assertEquals(200, $searchPage->getStatusCode());
553 553
 
554
-        $response = $this->submitForm("ElasticSearchForm_SearchForm", null, array(
555
-            'q' => 'New Zealand'
556
-        ));
554
+		$response = $this->submitForm("ElasticSearchForm_SearchForm", null, array(
555
+			'q' => 'New Zealand'
556
+		));
557 557
 
558 558
 		$url = rtrim($url, '/');
559
-        $this->assertEquals(302, $response->getStatusCode());
560
-        $this->assertEquals($url . '?q=New Zealand&sfid=testwithagg', $response->getHeader('Location'));
559
+		$this->assertEquals(302, $response->getStatusCode());
560
+		$this->assertEquals($url . '?q=New Zealand&sfid=testwithagg', $response->getHeader('Location'));
561 561
 	}
562 562
 
563 563
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 		$url = rtrim($url, '/');
76 76
 
77 77
         $response = $this->get($url);
78
-        error_log(print_r($response,1));
78
+        error_log(print_r($response, 1));
79 79
         $this->assertEquals(200, $response->getStatusCode());
80 80
 
81 81
         $this->assertSelectorStartsWithOrEquals('span.count', 0, '(5)');
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 		$url .= '?ISO=400';
130 130
 
131 131
         $response = $this->get($url);
132
-        error_log(print_r($response,1));
132
+        error_log(print_r($response, 1));
133 133
         $this->assertEquals(200, $response->getStatusCode());
134 134
 
135 135
         // These are less than in the no facets selected case, as expected
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		$url .= '?ISO=400&ShutterSpeed=2%2F250';
178 178
 
179 179
         $response = $this->get($url);
180
-        error_log(print_r($response,1));
180
+        error_log(print_r($response, 1));
181 181
         $this->assertEquals(200, $response->getStatusCode());
182 182
 
183 183
         // These are less than in the one facet selected case, as expected
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	public function testQueryInSearchBoxForOneFormOnly() {
250 250
 		$searchPageObj = $this->ElasticSearchPage2;
251 251
 		$url = rtrim($searchPageObj->Link(), '/');
252
-		$url .= "?q=Auckland&sfid=".$searchPageObj->Identifier;
252
+		$url .= "?q=Auckland&sfid=" . $searchPageObj->Identifier;
253 253
 		$response = $this->get($url);
254 254
 		$this->assertEquals(200, $response->getStatusCode());
255 255
 		$this->assertAttributeHasExactValue('#ElasticSearchForm_SearchForm_q', 'q',
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 		$url .= "/similar/FlickrPhotoTO/77";
383 383
 		$response = $this->get($url);
384 384
 
385
-		error_log(print_r($response,1));
385
+		error_log(print_r($response, 1));
386 386
 
387 387
 		//Title of the original is "[Texas and New Orleans, Southern Pacific Railroad Station, Sierra Blanca, Texas]"
388 388
 		$this->assertSelectorStartsWithOrEquals('div.searchResult a', 0, '[ and New Orleans, Southern Pacific Railroad Station, Sinton, ]');
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 		$url = rtrim($searchPageObj->Link(), '/');
418 418
 		$url .= "?q=New%20Zealind&TestMode=true";
419 419
 		$response = $this->get($url);
420
-		error_log(print_r($response,1));
420
+		error_log(print_r($response, 1));
421 421
 		$this->assertEquals(200, $response->getStatusCode());
422 422
 		$this->assertSelectorStartsWithOrEquals('p.showingResultsForMsg', 0, 'Showing results for ');
423 423
 		$this->assertSelectorStartsWithOrEquals('p.showingResultsForMsg a', 0, 'New ');
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 		//Note pages need to be published, by default fixtures only reside in Stage
511 511
 		$searchPageObj = $this->ElasticSearchPage2;
512 512
 		$url = rtrim($searchPageObj->Link(), '/');
513
-		$url = $url.'?q='.$searchTerm;
513
+		$url = $url . '?q=' . $searchTerm;
514 514
 		$response = $this->get($url);
515 515
 		$this->assertEquals(200, $response->getStatusCode());
516 516
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 		//Note pages need to be published, by default fixtures only reside in Stage
578 578
 		$searchPageObj = $this->ElasticSearchPage;
579 579
 		$url = rtrim($searchPageObj->Link(), '/');
580
-		$url = $url.'?q='.$searchTerm;
580
+		$url = $url . '?q=' . $searchTerm;
581 581
 		$response = $this->get($url);
582 582
 		$this->assertEquals(200, $response->getStatusCode());
583 583
 
@@ -708,18 +708,18 @@  discard block
 block discarded – undo
708 708
 		//increase the number of results and assert that they are the same as per pages 1,2 joined
709 709
 		$searchPageObj->ResultsPerPage = 20;
710 710
 		$searchPageObj->write();
711
-		$searchPageObj->publish('Stage','Live');
711
+		$searchPageObj->publish('Stage', 'Live');
712 712
 		$response3 = $this->get($firstPageURL);
713 713
 	}
714 714
 
715 715
 
716 716
 	private function enableHighlights() {
717
-		foreach (SearchableField::get()->filter('Name', 'Title') as $sf) {
717
+		foreach(SearchableField::get()->filter('Name', 'Title') as $sf) {
718 718
 			$sf->ShowHighlights = true;
719 719
 			$sf->write();
720 720
 		}
721 721
 
722
-		foreach (SearchableField::get()->filter('Name', 'Content') as $sf) {
722
+		foreach(SearchableField::get()->filter('Name', 'Content') as $sf) {
723 723
 			$sf->ShowHighlights = true;
724 724
 			$sf->write();
725 725
 		}
Please login to merge, or discard this patch.