|
|
@@ -473,4 +473,28 @@ class SqliteTest extends CakeTestCase {
|
|
|
$this->assertNotEmpty($model->read(null, 1));
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Test the limit function.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testLimit() {
|
|
|
+ $db = $this->Dbo;
|
|
|
+
|
|
|
+ $result = $db->limit('0');
|
|
|
+ $this->assertNull($result);
|
|
|
+
|
|
|
+ $result = $db->limit('10');
|
|
|
+ $this->assertEquals(' LIMIT 10', $result);
|
|
|
+
|
|
|
+ $result = $db->limit('FARTS', 'BOOGERS');
|
|
|
+ $this->assertEquals(' LIMIT 0 OFFSET 0', $result);
|
|
|
+
|
|
|
+ $result = $db->limit(20, 10);
|
|
|
+ $this->assertEquals(' LIMIT 20 OFFSET 10', $result);
|
|
|
+
|
|
|
+ $result = $db->limit(10, 300000000000000000000000000000);
|
|
|
+ $this->assertEquals(' LIMIT 10 OFFSET 0', $result);
|
|
|
+ }
|
|
|
+
|
|
|
}
|