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
This commit is contained in:
gwoo 2007-06-27 15:25:37 +00:00
parent f3b67a24e1
commit c00238ec3a

View file

@ -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('/<script type="text\/javascript">Event.observe/', $result);
}
function tearDown() {