Adding Paginator test case for disabled links (Ticket #3253)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5774 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-10-17 06:20:38 +00:00
parent 4e795bc22c
commit dcdfa005cf

View file

@ -81,12 +81,20 @@ class PaginatorTest extends UnitTestCase {
$this->Paginator->params['paging']['Article']['nextPage'] = true;
}
function testDisabledLink() {
$this->Paginator->params['paging']['Article']['nextPage'] = false;
$this->Paginator->params['paging']['Article']['page'] = 1;
$result = $this->Paginator->next('Next', array(), true);
$expected = '<div>Next</div>';
$this->assertEqual($result, $expected);
}
function testSortLinks() {
Router::reload();
Router::parse('/');
Router::setRequestInfo(array(
array ('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true'), 'bare' => 0),
array ('plugin' => null, 'controller' => null, 'action' => null, 'base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/', 'passedArgs' => array())
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true'), 'bare' => 0),
array('plugin' => null, 'controller' => null, 'action' => null, 'base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/', 'passedArgs' => array())
));
$this->Paginator->options(array('url' => array('param')));
$result = $this->Paginator->sort('title');