@@ 487-494 (lines=8) @@ | ||
484 | "wireless123"); |
|
485 | } |
|
486 | ||
487 | public function testSimpleToUrlOneReplace() |
|
488 | { |
|
489 | $this->beautifier->setSearchMapping("q") |
|
490 | ->addReplacementRule("/", "-"); |
|
491 | $searchString = "this is/a test"; |
|
492 | $this->assertEquals("/this+is-a+test/q?z=8-%2F", $this->beautifier->toUrl($searchString, null)); |
|
493 | $this->assertToAndFromUrl($searchString, null); |
|
494 | } |
|
495 | ||
496 | public function testSimpleToUrlMultipleReplace() |
|
497 | { |
|
@@ 496-504 (lines=9) @@ | ||
493 | $this->assertToAndFromUrl($searchString, null); |
|
494 | } |
|
495 | ||
496 | public function testSimpleToUrlMultipleReplace() |
|
497 | { |
|
498 | $this->beautifier->setSearchMapping("q") |
|
499 | ->addReplacementRule("/", "-") |
|
500 | ->addReplacementRule("T", "t"); |
|
501 | $searchString = "This is/a Test"; |
|
502 | $this->assertEquals("/this+is-a+test/q?z=8-%2F-1-T-11-T", $this->beautifier->toUrl($searchString, null)); |
|
503 | $this->assertToAndFromUrl($searchString, null); |
|
504 | } |
|
505 | ||
506 | public function testSimpleToUrlReplaceWithEmpty() |
|
507 | { |
|
@@ 506-513 (lines=8) @@ | ||
503 | $this->assertToAndFromUrl($searchString, null); |
|
504 | } |
|
505 | ||
506 | public function testSimpleToUrlReplaceWithEmpty() |
|
507 | { |
|
508 | $this->beautifier->setSearchMapping("q") |
|
509 | ->addReplacementRule("/", null); |
|
510 | $searchString = "this is/a test"; |
|
511 | $this->assertEquals("/this+isa+test/q?z=i8-%2F", $this->beautifier->toUrl($searchString, null)); |
|
512 | $this->assertToAndFromUrl($searchString, null); |
|
513 | } |
|
514 | ||
515 | public function testSimpleToUrlMultipleReplaceWithEmpty() |
|
516 | { |
|
@@ 515-523 (lines=9) @@ | ||
512 | $this->assertToAndFromUrl($searchString, null); |
|
513 | } |
|
514 | ||
515 | public function testSimpleToUrlMultipleReplaceWithEmpty() |
|
516 | { |
|
517 | $this->beautifier->setSearchMapping("q") |
|
518 | ->addReplacementRule("/", null) |
|
519 | ->addReplacementRule("_", null); |
|
520 | $searchString = "this _is/a _test"; |
|
521 | $this->assertEquals("/this+isa+test/q?z=i9-%2F-i6-_-i10-_", $this->beautifier->toUrl($searchString, null)); |
|
522 | $this->assertToAndFromUrl($searchString, null); |
|
523 | } |
|
524 | ||
525 | public function testSimpleToUrlMultipleReplaceOrderMatters() |
|
526 | { |