@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | /** |
| 5 | 5 | * Alter the query or add to it, perhaps for example adding aggregation |
| 6 | 6 | * @param Elastic\Query &$query query object from Elastica |
| 7 | - * @return [type] [description] |
|
| 7 | + * @return void [description] |
|
| 8 | 8 | */ |
| 9 | 9 | public function augmentQuery(&$query); |
| 10 | 10 | |
@@ -12,6 +12,7 @@ discard block |
||
| 12 | 12 | * Update filters, perhaps remaps them, prior to performing a search. |
| 13 | 13 | * This allows for aggregation values to be updated prior to rendering. |
| 14 | 14 | * @param array &$filters array of key/value pairs for query filtering |
| 15 | + * @return void |
|
| 15 | 16 | */ |
| 16 | 17 | public function updateFilters(&$filters); |
| 17 | 18 | |
@@ -19,7 +20,7 @@ discard block |
||
| 19 | 20 | * Manipulate the array of aggregations post search butprior to rendering |
| 20 | 21 | * them in a template. |
| 21 | 22 | * @param [type] &$aggs [description] |
| 22 | - * @return [type] [description] |
|
| 23 | + * @return void [description] |
|
| 23 | 24 | */ |
| 24 | 25 | public function updateAggregation(&$aggs); |
| 25 | 26 | |
@@ -250,6 +250,9 @@ |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| 253 | + /** |
|
| 254 | + * @return integer |
|
| 255 | + */ |
|
| 253 | 256 | public function getTotalItems() { |
| 254 | 257 | $this->getResults(); |
| 255 | 258 | return $this->TotalItems; |
@@ -1036,6 +1036,7 @@ |
||
| 1036 | 1036 | /** |
| 1037 | 1037 | * Test searching |
| 1038 | 1038 | * http://stackoverflow.com/questions/28305250/elasticsearch-customize-score-for-synonyms-stemming |
| 1039 | + * @param string $queryText |
|
| 1039 | 1040 | */ |
| 1040 | 1041 | private function search($queryText,$fields = array('Title' => 1, 'Description' => 1), |
| 1041 | 1042 | $filters = array()) { |
@@ -153,6 +153,9 @@ |
||
| 153 | 153 | |
| 154 | 154 | /** |
| 155 | 155 | * Simulate a call to Elastica to get suggestions for a given phrase |
| 156 | + * @param string $phrase |
|
| 157 | + * @param string $suggestion |
|
| 158 | + * @param string $highlightedSuggestion |
|
| 156 | 159 | * @return [type] [description] |
| 157 | 160 | */ |
| 158 | 161 | private function getSuggestionArray($phrase, $suggestion, $highlightedSuggestion) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * Note: characters are stripped from the content; make sure that your assertions take this into account. |
| 103 | 103 | * |
| 104 | 104 | * @param string $selector A basic CSS selector, e.g. 'li.jobs h3' |
| 105 | - * @param array|string $expectedMatches The content of at least one of the matched tags |
|
| 105 | + * @param integer $index |
|
| 106 | 106 | * @throws PHPUnit_Framework_AssertionFailedError |
| 107 | 107 | * @return boolean |
| 108 | 108 | */ |
@@ -133,6 +133,12 @@ discard block |
||
| 133 | 133 | /* |
| 134 | 134 | Check all the nodes matching the selector for attribute name = expected value |
| 135 | 135 | */ |
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * @param string $selector |
|
| 139 | + * @param string $attributeName |
|
| 140 | + * @param string $expectedValue |
|
| 141 | + */ |
|
| 136 | 142 | public function assertAttributeHasExactValue($selector, $attributeName, $expectedValue) { |
| 137 | 143 | $items = $this->cssParser()->getBySelector($selector); |
| 138 | 144 | foreach ($items as $item) { |
@@ -141,6 +147,9 @@ discard block |
||
| 141 | 147 | } |
| 142 | 148 | |
| 143 | 149 | |
| 150 | + /** |
|
| 151 | + * @param string $selector |
|
| 152 | + */ |
|
| 144 | 153 | public function assertAttributesHaveExactValues($selector, $expectedValues) { |
| 145 | 154 | $attributeNames = array_keys($expectedValues); |
| 146 | 155 | $items = $this->cssParser()->getBySelector($selector); |
@@ -154,6 +163,10 @@ discard block |
||
| 154 | 163 | } |
| 155 | 164 | |
| 156 | 165 | |
| 166 | + /** |
|
| 167 | + * @param string $selector |
|
| 168 | + * @param integer $expectedAmount |
|
| 169 | + */ |
|
| 157 | 170 | public function assertNumberOfNodes($selector, $expectedAmount) { |
| 158 | 171 | $items = $this->cssParser()->getBySelector($selector); |
| 159 | 172 | foreach ($items as $item) { |
@@ -106,6 +106,10 @@ |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | + /** |
|
| 110 | + * @param string $fieldName |
|
| 111 | + * @param string $message |
|
| 112 | + */ |
|
| 109 | 113 | private function checkForError($fieldName, $badValue, $message) { |
| 110 | 114 | $this->ElasticSearchPage->$fieldName = $badValue; |
| 111 | 115 | |
@@ -132,6 +132,10 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| 135 | + /** |
|
| 136 | + * @param integer $depth |
|
| 137 | + * @param string $parentKey |
|
| 138 | + */ |
|
| 135 | 139 | private function recurseArrayAssertion($toAssert, $depth, $parentKey) { |
| 136 | 140 | $prefix = str_repeat("\t",$depth); |
| 137 | 141 | echo "\t{$prefix}'$parentKey' => array(\n"; |
@@ -160,6 +164,10 @@ discard block |
||
| 160 | 164 | /* |
| 161 | 165 | Helper methods for testing CMS fields |
| 162 | 166 | */ |
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * @param string $tabName |
|
| 170 | + */ |
|
| 163 | 171 | public function checkTabExists($fields, $tabName) { |
| 164 | 172 | echo "Searching for tab $tabName\n"; |
| 165 | 173 | $tab = $fields->findOrMakeTab("Root.{$tabName}"); |
@@ -184,6 +192,9 @@ discard block |
||
| 184 | 192 | } |
| 185 | 193 | |
| 186 | 194 | |
| 195 | + /** |
|
| 196 | + * @param string $fieldName |
|
| 197 | + */ |
|
| 187 | 198 | public function checkFieldExists($tab,$fieldName) { |
| 188 | 199 | $fields = $tab->Fields(); |
| 189 | 200 | echo "TAB:{$tab->Name}\n"; |
@@ -479,6 +479,9 @@ |
||
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | |
| 482 | + /** |
|
| 483 | + * @param string $query |
|
| 484 | + */ |
|
| 482 | 485 | private function getResultsFor($query, $pageLength = 10, $fields = array('Title' => 1, 'Description' => 1)) { |
| 483 | 486 | $es = new ElasticSearcher(); |
| 484 | 487 | $es->setStart(0); |
@@ -233,6 +233,9 @@ |
||
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | |
| 236 | + /** |
|
| 237 | + * @param PaginatedList $paginated |
|
| 238 | + */ |
|
| 236 | 239 | private function makeCode($paginated) { |
| 237 | 240 | $results = $paginated->getList()->toArray(); |
| 238 | 241 | $ctr = 0; |