File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
tests/TestCase/View/Helper Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -421,6 +421,41 @@ public function testSortLinksUsingDotNotation()
421
421
$ this ->assertHtml ($ expected , $ result );
422
422
}
423
423
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
+
424
459
/**
425
460
* testSortKey method
426
461
*
You can’t perform that action at this time.
0 commit comments