5 include_once __DIR__
."/../../../setup.inc";
7 class RowTest
extends \PHPUnit_Framework_TestCase
{
15 * @var \pq\Gateway\Table
19 protected function setUp() {
20 $this->conn
= new \pq\
Connection(PQ_TEST_DSN
);
21 $this->conn
->exec(PQ_TEST_TABLE_CREATE
);
22 $this->conn
->exec(PQ_TEST_REFTABLE_CREATE
);
23 $this->conn
->exec(PQ_TEST_DATA
);
24 Table
::$defaultConnection = $this->conn
;
25 $this->table
= new Table("test");
28 protected function tearDown() {
29 $this->conn
->exec(PQ_TEST_REFTABLE_DROP
);
30 $this->conn
->exec(PQ_TEST_TABLE_DROP
);
33 function testBasic() {
34 $row = new Row($this->table
, array("id" => 3), true);
35 $this->assertTrue($row->isDirty());
40 "created" => date("Y-m-d H:i:s", strtotime("tomorrow")),
47 $this->assertFalse($row->isDirty());
50 function testGetTable() {
51 $row = new Row($this->table
);
52 $this->assertSame($this->table
, $row->getTable());