summaryrefslogtreecommitdiff
path: root/tests/unit/Data/SqlMap/queryForListLimitTest.php
blob: 72351c72ba927da663810cdd884a4af69f45749b (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
<?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->assertEquals(count($list1),2);

		$this->assertEquals($list1[0][0],'2');
		$this->assertEquals($list1[0][1],'Averel');
		$this->assertEquals($list1[0][2],'Dalton');

		$this->assertEquals($list1[1][0],'3');
		$this->assertEquals($list1[1][1],'William');
		$this->assertEquals($list1[1][2],'Dalton');
	}
}