|
|
@@ -219,8 +219,6 @@ class FormatHelperTest extends TestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * FormatHelperTest::testPad()
|
|
|
- *
|
|
|
* @return void
|
|
|
*/
|
|
|
public function testPad() {
|
|
|
@@ -234,8 +232,6 @@ class FormatHelperTest extends TestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * FormatHelperTest::testAbsolutePaginateCount()
|
|
|
- *
|
|
|
* @return void
|
|
|
*/
|
|
|
public function testAbsolutePaginateCount() {
|
|
|
@@ -243,10 +239,35 @@ class FormatHelperTest extends TestCase {
|
|
|
'page' => 1,
|
|
|
'pageCount' => 3,
|
|
|
'count' => 25,
|
|
|
- 'limit' => 10,
|
|
|
+ 'perPage' => 10,
|
|
|
];
|
|
|
$result = $this->Format->absolutePaginateCount($paginator, 2);
|
|
|
- $this->assertEquals(2, $result);
|
|
|
+ $this->assertSame(2, $result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testAbsolutePaginateCountDesc() {
|
|
|
+ // 2nd element on page 1
|
|
|
+ $paginator = [
|
|
|
+ 'page' => 1,
|
|
|
+ 'pageCount' => 3,
|
|
|
+ 'count' => 25,
|
|
|
+ 'perPage' => 10,
|
|
|
+ ];
|
|
|
+ $result = $this->Format->absolutePaginateCount($paginator, 2, 'DESC');
|
|
|
+ $this->assertSame(24, $result);
|
|
|
+
|
|
|
+ // 3rd element on page 3
|
|
|
+ $paginator = [
|
|
|
+ 'page' => 3,
|
|
|
+ 'pageCount' => 3,
|
|
|
+ 'count' => 25,
|
|
|
+ 'perPage' => 10,
|
|
|
+ ];
|
|
|
+ $result = $this->Format->absolutePaginateCount($paginator, 3, 'DESC');
|
|
|
+ $this->assertSame(3, $result);
|
|
|
}
|
|
|
|
|
|
/**
|