blob: 953f83e6f2699ffe2d52f071835e6c34e126d452 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<?php
Prado::using('System.Data.ActiveRecord.TActiveRecord');
require_once(dirname(__FILE__).'/records/DepartmentRecord.php');
class FindBySqlTestCase extends UnitTestCase
{
function setup()
{
$conn = new TDbConnection('pgsql:host=localhost;dbname=test', 'test','test');
TActiveRecordManager::getInstance()->setDbConnection($conn);
}
function test_find_by_sql()
{
$deps = DepartmentRecord::finder()->findBySql('SELECT * FROM departments');
$this->assertTrue(count($deps) > 0);
}
}
?>
|