@@ -115,10 +115,10 @@ discard block |
||
| 115 | 115 | $this->assertEquals(200, $searchPage->getStatusCode()); |
| 116 | 116 | $url = rtrim($url,'/'); |
| 117 | 117 | |
| 118 | - $response = $this->get($url); |
|
| 119 | - $this->assertEquals(200, $response->getStatusCode()); |
|
| 118 | + $response = $this->get($url); |
|
| 119 | + $this->assertEquals(200, $response->getStatusCode()); |
|
| 120 | 120 | |
| 121 | - $this->assertSelectorStartsWithOrEquals('span.count', 0, '(5)'); |
|
| 121 | + $this->assertSelectorStartsWithOrEquals('span.count', 0, '(5)'); |
|
| 122 | 122 | $this->assertSelectorStartsWithOrEquals('span.count', 1, '(11)'); |
| 123 | 123 | $this->assertSelectorStartsWithOrEquals('span.count', 2, '(12)'); |
| 124 | 124 | $this->assertSelectorStartsWithOrEquals('span.count', 3, '(13)'); |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | $url = rtrim($url,'/'); |
| 169 | 169 | $url .= '?ISO=400'; |
| 170 | 170 | |
| 171 | - $response = $this->get($url); |
|
| 172 | - $this->assertEquals(200, $response->getStatusCode()); |
|
| 171 | + $response = $this->get($url); |
|
| 172 | + $this->assertEquals(200, $response->getStatusCode()); |
|
| 173 | 173 | |
| 174 | - // These are less than in the no facets selected case, as expected |
|
| 174 | + // These are less than in the no facets selected case, as expected |
|
| 175 | 175 | $this->assertSelectorStartsWithOrEquals('span.count', 0, '(2)'); |
| 176 | 176 | $this->assertSelectorStartsWithOrEquals('span.count', 1, '(1)'); |
| 177 | 177 | $this->assertSelectorStartsWithOrEquals('span.count', 2, '(2)'); |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | $url = rtrim($url,'/'); |
| 216 | 216 | $url .= '?ISO=400&ShutterSpeed=2%2F250'; |
| 217 | 217 | |
| 218 | - $response = $this->get($url); |
|
| 218 | + $response = $this->get($url); |
|
| 219 | 219 | print_r($response); |
| 220 | - $this->assertEquals(200, $response->getStatusCode()); |
|
| 220 | + $this->assertEquals(200, $response->getStatusCode()); |
|
| 221 | 221 | |
| 222 | - // These are less than in the one facet selected case, as expected |
|
| 223 | - $this->assertSelectorStartsWithOrEquals('span.count', 0, '(1)'); |
|
| 222 | + // These are less than in the one facet selected case, as expected |
|
| 223 | + $this->assertSelectorStartsWithOrEquals('span.count', 0, '(1)'); |
|
| 224 | 224 | $this->assertSelectorStartsWithOrEquals('span.count', 1, '(2)'); |
| 225 | 225 | $this->assertSelectorStartsWithOrEquals('span.count', 2, '(1)'); |
| 226 | 226 | $this->assertSelectorStartsWithOrEquals('span.count', 3, '(1)'); |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | $url = rtrim($url,'/'); |
| 250 | 250 | $url .= '?ISO=400&ShutterSpeed=2%2F250&Aspect=Vertical'; |
| 251 | 251 | |
| 252 | - $response = $this->get($url); |
|
| 252 | + $response = $this->get($url); |
|
| 253 | 253 | print_r($response); |
| 254 | - $this->assertEquals(200, $response->getStatusCode()); |
|
| 254 | + $this->assertEquals(200, $response->getStatusCode()); |
|
| 255 | 255 | |
| 256 | - // These are less than in the one facet selected case, as expected |
|
| 257 | - $this->assertSelectorStartsWithOrEquals('span.count', 0, '(2)'); |
|
| 256 | + // These are less than in the one facet selected case, as expected |
|
| 257 | + $this->assertSelectorStartsWithOrEquals('span.count', 0, '(2)'); |
|
| 258 | 258 | $this->assertSelectorStartsWithOrEquals('span.count', 1, '(1)'); |
| 259 | 259 | $this->assertSelectorStartsWithOrEquals('span.count', 2, '(1)'); |
| 260 | 260 | } |
@@ -602,13 +602,13 @@ discard block |
||
| 602 | 602 | $searchPage = $this->get($searchPageObj->URLSegment); |
| 603 | 603 | $this->assertEquals(200, $searchPage->getStatusCode()); |
| 604 | 604 | |
| 605 | - $response = $this->submitForm("ElasticSearchForm_SearchForm", null, array( |
|
| 606 | - 'q' => 'New Zealand' |
|
| 607 | - )); |
|
| 605 | + $response = $this->submitForm("ElasticSearchForm_SearchForm", null, array( |
|
| 606 | + 'q' => 'New Zealand' |
|
| 607 | + )); |
|
| 608 | 608 | |
| 609 | 609 | $url = rtrim($url,'/'); |
| 610 | - $this->assertEquals(302, $response->getStatusCode()); |
|
| 611 | - $this->assertEquals($url.'?q=New Zealand&sfid=testwithagg', $response->getHeader('Location')); |
|
| 610 | + $this->assertEquals(302, $response->getStatusCode()); |
|
| 611 | + $this->assertEquals($url.'?q=New Zealand&sfid=testwithagg', $response->getHeader('Location')); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | $esp2->write(); |
| 50 | 50 | |
| 51 | - $esfs= $esp->ElasticaSearchableFields(); |
|
| 51 | + $esfs = $esp->ElasticaSearchableFields(); |
|
| 52 | 52 | |
| 53 | 53 | foreach ($esfs as $sf) { |
| 54 | 54 | if ($sf->Name == 'Title' || $sf->Name == 'Description') { |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | $esp->ElasticaSearchableFields()->add($espf2); |
| 81 | 81 | $esp2->ElasticaSearchableFields()->add($espf2); |
| 82 | 82 | */ |
| 83 | - $esp->publish('Stage','Live'); |
|
| 84 | - $esp2->publish('Stage','Live'); |
|
| 83 | + $esp->publish('Stage', 'Live'); |
|
| 84 | + $esp2->publish('Stage', 'Live'); |
|
| 85 | 85 | $this->ElasticSearchPage = $esp; |
| 86 | - $this->ElasticSearchPage2= $esp2; |
|
| 86 | + $this->ElasticSearchPage2 = $esp2; |
|
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | echo "CHECK MYSQL"; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $url = $searchPageObj->Link(); |
| 114 | 114 | $searchPage = $this->get($searchPageObj->URLSegment); |
| 115 | 115 | $this->assertEquals(200, $searchPage->getStatusCode()); |
| 116 | - $url = rtrim($url,'/'); |
|
| 116 | + $url = rtrim($url, '/'); |
|
| 117 | 117 | |
| 118 | 118 | $response = $this->get($url); |
| 119 | 119 | $this->assertEquals(200, $response->getStatusCode()); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $url = $searchPageObj->Link(); |
| 166 | 166 | $searchPage = $this->get($searchPageObj->URLSegment); |
| 167 | 167 | $this->assertEquals(200, $searchPage->getStatusCode()); |
| 168 | - $url = rtrim($url,'/'); |
|
| 168 | + $url = rtrim($url, '/'); |
|
| 169 | 169 | $url .= '?ISO=400'; |
| 170 | 170 | |
| 171 | 171 | $response = $this->get($url); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $url = $searchPageObj->Link(); |
| 213 | 213 | $searchPage = $this->get($searchPageObj->URLSegment); |
| 214 | 214 | $this->assertEquals(200, $searchPage->getStatusCode()); |
| 215 | - $url = rtrim($url,'/'); |
|
| 215 | + $url = rtrim($url, '/'); |
|
| 216 | 216 | $url .= '?ISO=400&ShutterSpeed=2%2F250'; |
| 217 | 217 | |
| 218 | 218 | $response = $this->get($url); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $url = $searchPageObj->Link(); |
| 247 | 247 | $searchPage = $this->get($searchPageObj->URLSegment); |
| 248 | 248 | $this->assertEquals(200, $searchPage->getStatusCode()); |
| 249 | - $url = rtrim($url,'/'); |
|
| 249 | + $url = rtrim($url, '/'); |
|
| 250 | 250 | $url .= '?ISO=400&ShutterSpeed=2%2F250&Aspect=Vertical'; |
| 251 | 251 | |
| 252 | 252 | $response = $this->get($url); |
@@ -290,9 +290,9 @@ discard block |
||
| 290 | 290 | public function testQueryInSearchBoxForOneFormOnly() { |
| 291 | 291 | $searchPageObj = $this->ElasticSearchPage2; |
| 292 | 292 | $url = rtrim($searchPageObj->Link(), '/'); |
| 293 | - $url .= "?q=Auckland&sfid=".$searchPageObj->Identifier; |
|
| 293 | + $url .= "?q=Auckland&sfid=" . $searchPageObj->Identifier; |
|
| 294 | 294 | |
| 295 | - echo "URL:".$url; |
|
| 295 | + echo "URL:" . $url; |
|
| 296 | 296 | $response = $this->get($url); |
| 297 | 297 | |
| 298 | 298 | print_r($response); |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | $pageLength = 10; // the default |
| 320 | 320 | $searchPageObj->ResultsPerPage = $pageLength; |
| 321 | 321 | $searchPageObj->write(); |
| 322 | - $searchPageObj->publish('Stage','Live'); |
|
| 322 | + $searchPageObj->publish('Stage', 'Live'); |
|
| 323 | 323 | |
| 324 | 324 | $url = rtrim($searchPageObj->Link(), '/'); |
| 325 | 325 | $response = $this->get($url); |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | //Note pages need to be published, by default fixtures only reside in Stage |
| 559 | 559 | $searchPageObj = $this->ElasticSearchPage2; |
| 560 | 560 | $url = rtrim($searchPageObj->Link(), '/'); |
| 561 | - $url = $url.'?q='.$searchTerm; |
|
| 561 | + $url = $url . '?q=' . $searchTerm; |
|
| 562 | 562 | echo "URL:$url\n"; |
| 563 | 563 | $response = $this->get($url); |
| 564 | 564 | $this->assertEquals(200, $response->getStatusCode()); |
@@ -606,9 +606,9 @@ discard block |
||
| 606 | 606 | 'q' => 'New Zealand' |
| 607 | 607 | )); |
| 608 | 608 | |
| 609 | - $url = rtrim($url,'/'); |
|
| 609 | + $url = rtrim($url, '/'); |
|
| 610 | 610 | $this->assertEquals(302, $response->getStatusCode()); |
| 611 | - $this->assertEquals($url.'?q=New Zealand&sfid=testwithagg', $response->getHeader('Location')); |
|
| 611 | + $this->assertEquals($url . '?q=New Zealand&sfid=testwithagg', $response->getHeader('Location')); |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | //Note pages need to be published, by default fixtures only reside in Stage |
| 629 | 629 | $searchPageObj = $this->ElasticSearchPage; |
| 630 | 630 | $url = rtrim($searchPageObj->Link(), '/'); |
| 631 | - $url = $url.'?q='.$searchTerm; |
|
| 631 | + $url = $url . '?q=' . $searchTerm; |
|
| 632 | 632 | echo "URL:$url\n"; |
| 633 | 633 | $response = $this->get($url); |
| 634 | 634 | $this->assertEquals(200, $response->getStatusCode()); |
@@ -673,13 +673,13 @@ discard block |
||
| 673 | 673 | $searchPageObj = $this->ElasticSearchPage; |
| 674 | 674 | $searchPageObj->SiteTreeOnly = true; |
| 675 | 675 | $searchPageObj->write(); |
| 676 | - $searchPageObj->publish('Stage','Live'); |
|
| 676 | + $searchPageObj->publish('Stage', 'Live'); |
|
| 677 | 677 | |
| 678 | 678 | |
| 679 | 679 | $pageLength = 10; // the default |
| 680 | 680 | $searchPageObj->ResultsPerPage = $pageLength; |
| 681 | 681 | $url = rtrim($searchPageObj->Link(), '/'); |
| 682 | - $url = $url.'?q='.$searchTerm; |
|
| 682 | + $url = $url . '?q=' . $searchTerm; |
|
| 683 | 683 | $firstPageURL = $url; |
| 684 | 684 | $response = $this->get($url); |
| 685 | 685 | $this->assertEquals(200, $response->getStatusCode()); |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | $pageLength = 10; // the default |
| 715 | 715 | $searchPageObj->ResultsPerPage = $pageLength; |
| 716 | 716 | $url = rtrim($searchPageObj->Link(), '/'); |
| 717 | - $url = $url.'?q='.$searchTerm; |
|
| 717 | + $url = $url . '?q=' . $searchTerm; |
|
| 718 | 718 | $firstPageURL = $url; |
| 719 | 719 | $response = $this->get($url); |
| 720 | 720 | $this->assertEquals(200, $response->getStatusCode()); |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | |
| 740 | 740 | $resultsP1 = $this->collateSearchResults(); |
| 741 | 741 | |
| 742 | - $page2url = $url . '&start='.$pageLength; |
|
| 742 | + $page2url = $url . '&start=' . $pageLength; |
|
| 743 | 743 | |
| 744 | 744 | //Check pagination on page 2 |
| 745 | 745 | $response2 = $this->get($page2url); |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | //increase the number of results and assert that they are the same as per pages 1,2 joined |
| 767 | 767 | $searchPageObj->ResultsPerPage = 20; |
| 768 | 768 | $searchPageObj->write(); |
| 769 | - $searchPageObj->publish('Stage','Live'); |
|
| 769 | + $searchPageObj->publish('Stage', 'Live'); |
|
| 770 | 770 | $response3 = $this->get($firstPageURL); |
| 771 | 771 | } |
| 772 | 772 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | // Delete and assert that it does not exist |
| 23 | 23 | echo "Displaying searchable fields\n"; |
| 24 | - $sql = "SELECT ID,Name,ClazzName from SearchableField"; |
|
| 24 | + $sql = "SELECT ID,Name,ClazzName from SearchableField"; |
|
| 25 | 25 | $records = DB::query($sql); |
| 26 | 26 | foreach ($records as $record) { |
| 27 | 27 | print_r($record); |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | $filter = array('Name' => 'Title', 'ClazzName' => 'FlickrPhotoTO'); |
| 31 | 31 | $sf = SearchableField::get()->filter($filter)->first(); |
| 32 | 32 | print_r($sf); |
| 33 | - $sql = "UPDATE ElasticSearchPage_ElasticaSearchableFields SET Searchable=1,". |
|
| 34 | - "EnableAutocomplete=1 where SearchableFieldID=".$sf->ID; |
|
| 33 | + $sql = "UPDATE ElasticSearchPage_ElasticaSearchableFields SET Searchable=1," . |
|
| 34 | + "EnableAutocomplete=1 where SearchableFieldID=" . $sf->ID; |
|
| 35 | 35 | echo $sql; |
| 36 | 36 | |
| 37 | 37 | DB::query($sql); |
@@ -17,8 +17,8 @@ |
||
| 17 | 17 | sort($terms); |
| 18 | 18 | $expected = array('Description', 'Description.shingles', 'Description.standard', |
| 19 | 19 | 'ShutterSpeed', |
| 20 | - 'TestMethod','TestMethod.shingles','TestMethod.standard', |
|
| 21 | - 'TestMethodHTML','TestMethodHTML.shingles','TestMethodHTML.standard', |
|
| 20 | + 'TestMethod', 'TestMethod.shingles', 'TestMethod.standard', |
|
| 21 | + 'TestMethodHTML', 'TestMethodHTML.shingles', 'TestMethodHTML.standard', |
|
| 22 | 22 | 'Title', 'Title.autocomplete', 'Title.shingles', 'Title.standard'); |
| 23 | 23 | $this->assertEquals($expected, $terms); |
| 24 | 24 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $this->invokeMethod($this->service, 'createIndex', array()); |
| 28 | 28 | $this->assertFalse(true, "Creation of index with unknown locale should have failed"); |
| 29 | 29 | } catch (Exception $e) { |
| 30 | - $this->assertTrue(true,"Creation of index with unknown locale failed as expected"); |
|
| 30 | + $this->assertTrue(true, "Creation of index with unknown locale failed as expected"); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $fp->write(); |
| 117 | 117 | $this->service->getIndex()->refresh(); |
| 118 | 118 | |
| 119 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart-1); |
|
| 119 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart - 1); |
|
| 120 | 120 | |
| 121 | 121 | $fp->ShowInSearch = true; |
| 122 | 122 | $fp->write(); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $fp->doUnpublish(); |
| 135 | 135 | |
| 136 | 136 | $this->service->getIndex()->refresh(); |
| 137 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart-1); |
|
| 137 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart - 1); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $fp->delete(); |
| 147 | 147 | |
| 148 | 148 | $this->service->getIndex()->refresh(); |
| 149 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart-1); |
|
| 149 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart - 1); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $fp->delete(); |
| 159 | 159 | |
| 160 | 160 | $this->service->getIndex()->refresh(); |
| 161 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart-1); |
|
| 161 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart - 1); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | //Check that the number of indexing requests has increased by 2 |
| 178 | 178 | $deltaReqs = $this->service->getIndexingRequestCtr() - $reqs; |
| 179 | 179 | //One call is made for each of Page and FlickrPhotoTO |
| 180 | - $this->assertEquals(2,$deltaReqs); |
|
| 180 | + $this->assertEquals(2, $deltaReqs); |
|
| 181 | 181 | |
| 182 | 182 | // default installed pages plus 100 FlickrPhotoTOs |
| 183 | 183 | $this->checkNumberOfIndexedDocuments(103); |
@@ -195,21 +195,21 @@ discard block |
||
| 195 | 195 | $fp = new FlickrPhotoTO(); |
| 196 | 196 | $fp->Title = 'The cat sits on the mat'; |
| 197 | 197 | $fp->write(); |
| 198 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart+1); |
|
| 198 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart + 1); |
|
| 199 | 199 | |
| 200 | 200 | $fp2 = new FlickrPhotoTO(); |
| 201 | 201 | $fp2->Title = 'The cat sat on the hat'; |
| 202 | 202 | $fp2->write(); |
| 203 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart+2); |
|
| 203 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart + 2); |
|
| 204 | 204 | |
| 205 | 205 | $fp3 = new FlickrPhotoTO(); |
| 206 | 206 | $fp3->Title = 'The bat flew around the cat'; |
| 207 | 207 | $fp3->write(); |
| 208 | - $this->checkNumberOfIndexedDocuments($nDocsAtStart+3); |
|
| 208 | + $this->checkNumberOfIndexedDocuments($nDocsAtStart + 3); |
|
| 209 | 209 | |
| 210 | 210 | //Check that the number of indexing requests has increased by 3 |
| 211 | 211 | $deltaReqs = $this->service->getIndexingRequestCtr() - $reqs; |
| 212 | - $this->assertEquals(3,$deltaReqs); |
|
| 212 | + $this->assertEquals(3, $deltaReqs); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
@@ -283,6 +283,6 @@ discard block |
||
| 283 | 283 | public function testListIndexes() { |
| 284 | 284 | $message = 'This is a test trace'; |
| 285 | 285 | $trace = $this->service->listIndexes($message); |
| 286 | - $this->assertContains('elastica_ss_module_test_en_us', print_r($trace,1)); |
|
| 286 | + $this->assertContains('elastica_ss_module_test_en_us', print_r($trace, 1)); |
|
| 287 | 287 | } |
| 288 | 288 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $expected = array('first'); |
| 27 | 27 | $this->assertEquals($expected, array_keys($terms['Title.standard']['terms'])); |
| 28 | 28 | |
| 29 | - $expected = array('fi','fir','firs','first','ir','irs','irst','rs','rst','st'); |
|
| 29 | + $expected = array('fi', 'fir', 'firs', 'first', 'ir', 'irs', 'irst', 'rs', 'rst', 'st'); |
|
| 30 | 30 | $this->assertEquals($expected, array_keys($terms['Title.autocomplete']['terms'])); |
| 31 | 31 | |
| 32 | 32 | // ---- now a parental class page ---- |
@@ -60,20 +60,20 @@ discard block |
||
| 60 | 60 | $terms = $page->getTermVectors(); |
| 61 | 61 | |
| 62 | 62 | //Check the expected fields are indexed |
| 63 | - $expected = array('Content','Content.shingles','Content.standard','FatherText','FatherText.shingles','FatherText.standard', |
|
| 64 | - 'GrandFatherText','GrandFatherText.shingles','GrandFatherText.standard','Link','Title','Title.autocomplete', |
|
| 65 | - 'Title.shingles','Title.standard'); |
|
| 63 | + $expected = array('Content', 'Content.shingles', 'Content.standard', 'FatherText', 'FatherText.shingles', 'FatherText.standard', |
|
| 64 | + 'GrandFatherText', 'GrandFatherText.shingles', 'GrandFatherText.standard', 'Link', 'Title', 'Title.autocomplete', |
|
| 65 | + 'Title.shingles', 'Title.standard'); |
|
| 66 | 66 | $indexedFields = array_keys($terms); |
| 67 | 67 | sort($indexedFields); |
| 68 | 68 | foreach ($indexedFields as $field) { |
| 69 | - echo "'".$field."',"; |
|
| 69 | + echo "'" . $field . "',"; |
|
| 70 | 70 | } |
| 71 | 71 | $this->assertEquals($expected, $indexedFields); |
| 72 | 72 | |
| 73 | 73 | $fatherTerms = $terms['FatherText.standard']['terms']; |
| 74 | 74 | $grandFatherTerms = $terms['GrandFatherText.standard']['terms']; |
| 75 | 75 | |
| 76 | - $expected = array('father', 'field', 'grandfather', 'page', 'trace3');; |
|
| 76 | + $expected = array('father', 'field', 'grandfather', 'page', 'trace3'); ; |
|
| 77 | 77 | $this->assertEquals($expected, array_keys($fatherTerms)); |
| 78 | 78 | |
| 79 | 79 | $expected = array('grandfather', 'page', 'trace4'); |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | // don't check the server name as this will differ, just check the path is /search/ |
| 26 | 26 | $uri = $searchPage->SearchPageURI('testsearchpage'); |
| 27 | 27 | $splits = explode('/', $uri); |
| 28 | - $this->assertEquals($splits[3],'search'); |
|
| 28 | + $this->assertEquals($splits[3], 'search'); |
|
| 29 | 29 | |
| 30 | 30 | // check the form |
| 31 | 31 | $form = $searchPage->SearchPageForm('testsearchpage'); |
| 32 | - $this->assertInstanceOf('ElasticSearchForm',$form); |
|
| 32 | + $this->assertInstanceOf('ElasticSearchForm', $form); |
|
| 33 | 33 | |
| 34 | 34 | $fields = $form->Fields(); |
| 35 | 35 | $actions = $form->Actions(); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function testButtonOverride() { |
| 46 | 46 | $searchPage = $this->objFromFixture('ElasticSearchPage', 'search'); |
| 47 | 47 | $buttonText = 'Search Me!'; |
| 48 | - $form = $searchPage->SearchPageForm('testsearchpage',$buttonText); |
|
| 48 | + $form = $searchPage->SearchPageForm('testsearchpage', $buttonText); |
|
| 49 | 49 | $actions = $form->Actions(); |
| 50 | 50 | $this->assertEquals($buttonText, $actions->FieldByName('action_submit')->Title()); |
| 51 | 51 | } |
@@ -86,12 +86,12 @@ discard block |
||
| 86 | 86 | $esp = new ElasticSearchPage(); |
| 87 | 87 | // ensure default identifier |
| 88 | 88 | $esp->Identifier = $searchPage->Identifier; |
| 89 | - $esp->Title='This should not be saved'; |
|
| 89 | + $esp->Title = 'This should not be saved'; |
|
| 90 | 90 | try { |
| 91 | 91 | $esp->write(); |
| 92 | 92 | $this->assertFalse(true, 'Duplicate identifier was incorrectly saved'); |
| 93 | 93 | } catch (Exception $e) { |
| 94 | - $this->assertTrue(true,'The page could not be saved as expected, due to duplicate '. |
|
| 94 | + $this->assertTrue(true, 'The page could not be saved as expected, due to duplicate ' . |
|
| 95 | 95 | 'identifier'); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $germanWithURLs = array( |
| 29 | 29 | 'tokenizer' => 'uax_url_email', |
| 30 | 30 | //'filter' => array('english_possessive_stemmer', 'lowercase', 'english_stop', /*'english_keywords',*/ 'english_stemmer' ), |
| 31 | - 'filter' => array('no_single_chars', 'german_snowball', 'lowercase', 'german_stop' ), |
|
| 31 | + 'filter' => array('no_single_chars', 'german_snowball', 'lowercase', 'german_stop'), |
|
| 32 | 32 | 'type' => 'custom' |
| 33 | 33 | ); |
| 34 | 34 | |
@@ -214,7 +214,7 @@ |
||
| 214 | 214 | $analyzers['folded'] = $analyzerFolded; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - //Store bigrams in the index, namely pairs of words |
|
| 217 | + //Store bigrams in the index, namely pairs of words |
|
| 218 | 218 | $this->addFilter('filter_shingle', array( |
| 219 | 219 | 'type' => 'shingle', |
| 220 | 220 | 'min_shingle_size' => 2, |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | 'type' => 'nGram', |
| 178 | 178 | 'min_gram' => 2, |
| 179 | 179 | 'max_gram' => 20, |
| 180 | - 'token_chars' => array('letter', 'digit','punctuation', 'symbol') |
|
| 180 | + 'token_chars' => array('letter', 'digit', 'punctuation', 'symbol') |
|
| 181 | 181 | )); |
| 182 | 182 | |
| 183 | - $this->addAnalyzer('autocomplete_index_analyzer',array( |
|
| 183 | + $this->addAnalyzer('autocomplete_index_analyzer', array( |
|
| 184 | 184 | 'type' => 'custom', |
| 185 | 185 | 'tokenizer' => 'whitespace', |
| 186 | 186 | 'filter' => array( |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | ) |
| 191 | 191 | )); |
| 192 | 192 | |
| 193 | - $this->addAnalyzer('autocomplete_search_analyzer',array( |
|
| 193 | + $this->addAnalyzer('autocomplete_search_analyzer', array( |
|
| 194 | 194 | 'type' => 'custom', |
| 195 | 195 | 'tokenizer' => 'whitespace', |
| 196 | 196 | 'filter' => array( |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $englishWithURLs = array( |
| 48 | 48 | 'tokenizer' => 'uax_url_email', |
| 49 | 49 | //'filter' => array('english_possessive_stemmer', 'lowercase', 'english_stop', /*'english_keywords',*/ 'english_stemmer' ), |
| 50 | - 'filter' => array('no_single_chars', 'english_snowball', 'lowercase', $this->stopWordFilter ), |
|
| 50 | + 'filter' => array('no_single_chars', 'english_snowball', 'lowercase', $this->stopWordFilter), |
|
| 51 | 51 | 'type' => 'custom' |
| 52 | 52 | ); |
| 53 | 53 | |