|
@@ 50-59 (lines=10) @@
|
| 47 |
|
$this->assertEquals(1, count($navigations)); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
public function testAddRangeToUrl() |
| 51 |
|
{ |
| 52 |
|
$navigations = []; |
| 53 |
|
$this->beautifier->addRefinementMapping('c', 'category'); |
| 54 |
|
$refinement = new SelectedRefinementRange(); |
| 55 |
|
$refinement->setLow('12') |
| 56 |
|
->setHigh('34'); |
| 57 |
|
$url = UrlFunctions::toUrlAdd(self::DEFAULT_BEAUTIFIER, 'toast', $navigations, self::CATEGORY_NAVIGATION, $refinement); |
| 58 |
|
$this->assertEquals('/toast/q?refinements=%7Ecategory%3A12..34', $url); |
| 59 |
|
} |
| 60 |
|
public function testRemoveFromUrl() |
| 61 |
|
{ |
| 62 |
|
$navigations = []; |
|
@@ 191-203 (lines=13) @@
|
| 188 |
|
$this->assertEquals("/Women/Kid/Pink/ggc/index.html", $url); |
| 189 |
|
} |
| 190 |
|
|
| 191 |
|
public function testRefinementAdditionWithCategoryExpansion () { |
| 192 |
|
$navigations = []; |
| 193 |
|
|
| 194 |
|
$this->beautifier->addRefinementMapping('s', "size"); |
| 195 |
|
$this->beautifier->setAppend("/index.html"); |
| 196 |
|
|
| 197 |
|
$refinement = new SelectedRefinementValue(); |
| 198 |
|
$refinement->setValue("Category Root~Athletics~Men's~Sneakers"); |
| 199 |
|
|
| 200 |
|
|
| 201 |
|
$url = UrlFunctions::toUrlAdd(self::DEFAULT_BEAUTIFIER, '', $navigations, 'category_leaf_expanded', $refinement); |
| 202 |
|
$this->assertEquals("/index.html?refinements=%7Ecategory_leaf_expanded%3DCategory+Root%7EAthletics%7EMen%27s%7ESneakers", $url); |
| 203 |
|
} |
| 204 |
|
|
| 205 |
|
} |