From c00238ec3a5b39fbfef759929157fd10405112a4 Mon Sep 17 00:00:00 2001 From: gwoo Date: Wed, 27 Jun 2007 15:25:37 +0000 Subject: [PATCH] adding test for paginator numbers to prove fix for #2825 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5356 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/tests/cases/libs/view/helpers/paginator.test.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index c0eb941d4..3419f84fc 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -30,6 +30,8 @@ require_once LIBS.DS.'view'.DS.'helper.php'; require_once LIBS.DS.'view'.DS.'helpers'.DS.'html.php'; require_once LIBS.DS.'view'.DS.'helpers'.DS.'ajax.php'; + require_once LIBS.DS.'view'.DS.'helpers'.DS.'javascript.php'; + require_once LIBS.DS.'view'.DS.'helpers'.DS.'form.php'; require_once LIBS.DS.'view'.DS.'helpers'.DS.'paginator.php'; /** * Short description for class. @@ -63,6 +65,10 @@ class PaginatorTest extends UnitTestCase { ); $this->paginator->Html =& new HtmlHelper(); $this->paginator->Ajax =& new AjaxHelper(); + $this->paginator->Ajax->Html =& new HtmlHelper(); + $this->paginator->Ajax->Javascript =& new JavascriptHelper(); + $this->paginator->Ajax->Form =& new FormHelper(); + } function testHasPrevious() { @@ -91,6 +97,10 @@ class PaginatorTest extends UnitTestCase { $result = $this->paginator->sort('date'); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:date\/direction:desc"\s*>Date<\/a>$/', $result); + + $result = $this->paginator->numbers(array('url'=> array('controller'=>'projects', 'action'=>'sort'),'update'=>'list')); + $this->assertPattern('/\/projects\/sort\/page:1/', $result); + $this->assertPattern('/