Skip to content

Commit b0f37f6

Browse files
committed
Add tests from 6df7bf9 to 3.0
Ensure that #6090 is not an issue in 3.0
1 parent a8b99e2 commit b0f37f6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/TestCase/View/Helper/PaginatorHelperTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,41 @@ public function testSortLinksUsingDotNotation()
421421
$this->assertHtml($expected, $result);
422422
}
423423

424+
/**
425+
* Test creating paging links for missing models.
426+
*
427+
* @return void
428+
*/
429+
public function testPagingLinksMissingModel() {
430+
$result = $this->Paginator->sort('title', 'Title', ['model' => 'Missing']);
431+
$expected = [
432+
'a' => ['href' => '/index?sort=title&direction=asc'],
433+
'Title',
434+
'/a'
435+
];
436+
$this->assertHtml($expected, $result);
437+
438+
$result = $this->Paginator->next('Next', ['model' => 'Missing']);
439+
$expected = [
440+
'li' => ['class' => 'next disabled'],
441+
'a' => ['href' => ''],
442+
'Next',
443+
'/a',
444+
'/li'
445+
];
446+
$this->assertHtml($expected, $result);
447+
448+
$result = $this->Paginator->prev('Prev', ['model' => 'Missing']);
449+
$expected = [
450+
'li' => ['class' => 'prev disabled'],
451+
'a' => ['href' => ''],
452+
'Prev',
453+
'/a',
454+
'/li'
455+
];
456+
$this->assertHtml($expected, $result);
457+
}
458+
424459
/**
425460
* testSortKey method
426461
*

0 commit comments

Comments
 (0)