summaryrefslogtreecommitdiff
path: root/tests/simple_unit/SqlMap/queryForListLimitTest.php
blob: 349314a5070d24cd82c78c64252990ccb4f5d8de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

require_once(dirname(__FILE__).'/BaseCase.php');

/**
 * @package System.DataAccess.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');
	}
}

?>