Skip to content

Commit

Permalink
Add tests from 6df7bf9 to 3.0
Browse files Browse the repository at this point in the history
Ensure that #6090 is not an issue in 3.0
  • Loading branch information
markstory committed Mar 19, 2015
1 parent a8b99e2 commit b0f37f6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/TestCase/View/Helper/PaginatorHelperTest.php
Expand Up @@ -421,6 +421,41 @@ public function testSortLinksUsingDotNotation()
$this->assertHtml($expected, $result);
}

/**
* Test creating paging links for missing models.
*
* @return void
*/
public function testPagingLinksMissingModel() {
$result = $this->Paginator->sort('title', 'Title', ['model' => 'Missing']);
$expected = [
'a' => ['href' => '/index?sort=title&direction=asc'],
'Title',
'/a'
];
$this->assertHtml($expected, $result);

$result = $this->Paginator->next('Next', ['model' => 'Missing']);
$expected = [
'li' => ['class' => 'next disabled'],
'a' => ['href' => ''],
'Next',
'/a',
'/li'
];
$this->assertHtml($expected, $result);

$result = $this->Paginator->prev('Prev', ['model' => 'Missing']);
$expected = [
'li' => ['class' => 'prev disabled'],
'a' => ['href' => ''],
'Prev',
'/a',
'/li'
];
$this->assertHtml($expected, $result);
}

/**
* testSortKey method
*
Expand Down

0 comments on commit b0f37f6

Please sign in to comment.