summaryrefslogtreecommitdiff
path: root/tests/unit/Data/SqlMap/queryForListLimitTest.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2016-03-25 17:55:51 +0100
committerFabio Bas <ctrlaltca@gmail.com>2016-03-25 17:55:51 +0100
commita3388622287e218beddfa14a47ed677d4307b36b (patch)
tree1b4c7ac8597b1cc798b6683d4a81c90d38de12f6 /tests/unit/Data/SqlMap/queryForListLimitTest.php
parentc7fd3e1167b6f2fa7746edbd0fb8f8c1694c61f9 (diff)
Removed simpletest and moved all tests in the unit tree
Tests are executed now, but a lot of them need fixing.
Diffstat (limited to 'tests/unit/Data/SqlMap/queryForListLimitTest.php')
-rw-r--r--tests/unit/Data/SqlMap/queryForListLimitTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/unit/Data/SqlMap/queryForListLimitTest.php b/tests/unit/Data/SqlMap/queryForListLimitTest.php
new file mode 100644
index 00000000..7038dc68
--- /dev/null
+++ b/tests/unit/Data/SqlMap/queryForListLimitTest.php
@@ -0,0 +1,38 @@
+<?php
+
+require_once(dirname(__FILE__).'/BaseCase.php');
+
+/**
+ * @package System.Data.SqlMap
+ */
+class queryForListLimitTest extends BaseCase
+{
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->initSqlMap();
+
+ //force autoload
+ new Account;
+ }
+
+ function resetDatabase()
+ {
+ $this->initScript('account-init.sql');
+ }
+
+ function test_accounts_limit_2()
+ {
+ $list1 = $this->sqlmap->queryForList('GetAllAccountsAsArrayListViaResultClass',null,null,1,2);
+ $this->assertEqual(count($list1),2);
+
+ $this->assertEqual($list1[0][0],'2');
+ $this->assertEqual($list1[0][1],'Averel');
+ $this->assertEqual($list1[0][2],'Dalton');
+
+ $this->assertEqual($list1[1][0],'3');
+ $this->assertEqual($list1[1][1],'William');
+ $this->assertEqual($list1[1][2],'Dalton');
+ }
+}