Skip to content
Permalink
Browse files

Add tests for PaginatorHelper::generateUrl()

  • Loading branch information...
dereuromark committed Oct 5, 2016
1 parent f4179e3 commit 334e2f0900b8866c969b6f865044fe68d73c597d
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/TestCase/View/Helper/PaginatorHelperTest.php
@@ -28,6 +28,11 @@
class PaginatorHelperTest extends TestCase
{
/**
* @var string
*/
protected $locale;
/**
* setUp method
*
@@ -705,6 +710,22 @@ public function testUrlGeneration()
$options = ['sort' => 'Article.name', 'direction' => 'desc'];
$result = $this->Paginator->generateUrl($options);
$this->assertEquals('/index?page=3&sort=Article.name&direction=desc', $result);
$this->Paginator->request->params['paging']['Article']['page'] = 3;
$options = ['sort' => 'Article.name', 'direction' => 'desc'];
$result = $this->Paginator->generateUrl($options, null, ['escape' => false]);
$this->assertEquals('/index?page=3&sort=Article.name&direction=desc', $result);
$this->Paginator->request->params['paging']['Article']['page'] = 3;
$options = ['sort' => 'Article.name', 'direction' => 'desc'];
$result = $this->Paginator->generateUrl($options, null, ['fullBase' => true]);
$this->assertEquals('http://localhost/index?page=3&sort=Article.name&direction=desc', $result);
// @deprecated 3.3.5 Use fullBase array option instead.
$this->Paginator->request->params['paging']['Article']['page'] = 3;
$options = ['sort' => 'Article.name', 'direction' => 'desc'];
$result = $this->Paginator->generateUrl($options, null, true);
$this->assertEquals('http://localhost/index?page=3&sort=Article.name&direction=desc', $result);
}
/**

0 comments on commit 334e2f0

Please sign in to comment.
You can’t perform that action at this time.