|
@@ 534-545 (lines=12) @@
|
| 531 |
|
$this->assertToAndFromUrl("this _is/a _test", null); |
| 532 |
|
} |
| 533 |
|
|
| 534 |
|
public function testToUrlWithReplace() |
| 535 |
|
{ |
| 536 |
|
$this->setUpTestHeightAndCategoryRefinements(); |
| 537 |
|
$this->beautifier->setSearchMapping("q") |
| 538 |
|
->addReplacementRule("/", "-") |
| 539 |
|
->addReplacementRule("&", null); |
| 540 |
|
$searchString = "test&query"; |
| 541 |
|
$refinements = "test=value~height=20/in~category=computer accessories"; |
| 542 |
|
$url = $this->beautifier->toUrl($searchString, $refinements); |
| 543 |
|
$this->assertEquals("/value/20-in/computer+accessories/testquery/thcq?z=9-%2F-i38-%26", $url); |
| 544 |
|
$this->assertToAndFromUrl($searchString, $refinements, "value", "20/in", "computer accessories"); |
| 545 |
|
} |
| 546 |
|
|
| 547 |
|
public function testToUrlWithReplaceDash() |
| 548 |
|
{ |
|
@@ 547-558 (lines=12) @@
|
| 544 |
|
$this->assertToAndFromUrl($searchString, $refinements, "value", "20/in", "computer accessories"); |
| 545 |
|
} |
| 546 |
|
|
| 547 |
|
public function testToUrlWithReplaceDash() |
| 548 |
|
{ |
| 549 |
|
$this->setUpTestHeightAndCategoryRefinements(); |
| 550 |
|
$this->beautifier->setSearchMapping("q") |
| 551 |
|
->addReplacementRule("-", " ") |
| 552 |
|
->addReplacementRule("&", null); |
| 553 |
|
$searchString = "test&query"; |
| 554 |
|
$refinements = "test=value~height=20-in~category=computer accessories"; |
| 555 |
|
$url = $this->beautifier->toUrl($searchString, $refinements); |
| 556 |
|
$this->assertEquals("/value/20+in/computer+accessories/testquery/thcq?z=9---i38-%26", $url); |
| 557 |
|
$this->assertToAndFromUrl($searchString, $refinements, "value", "20-in", "computer accessories"); |
| 558 |
|
} |
| 559 |
|
|
| 560 |
|
public function testToUrlWithReplaceWithRefinement() |
| 561 |
|
{ |