Browse Source

Add tests from 6df7bf9c2161d600c0d4da6712cd68932171e9c8 to 3.0

Ensure that #6090 is not an issue in 3.0
Mark Story 11 years ago
parent
commit
b0f37f629a
1 changed files with 35 additions and 0 deletions
  1. 35 0
      tests/TestCase/View/Helper/PaginatorHelperTest.php

+ 35 - 0
tests/TestCase/View/Helper/PaginatorHelperTest.php

@@ -422,6 +422,41 @@ class PaginatorHelperTest extends TestCase
     }
 
     /**
+     * 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
      *
      * @return void