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_DSN
);
21 $this->conn
->exec(PQ_TEST_DROP_TABLE
);
22 $this->conn
->exec(PQ_TEST_CREATE_TABLE
);
23 $this->conn
->exec(PQ_TEST_CREATE_DATA
);
25 $this->table
= new Table(PQ_TEST_TABLE_NAME
, $this->conn
);
28 protected function tearDown() {
29 $this->conn
->exec(PQ_TEST_DROP_TABLE
);
32 function testBasic() {
33 $row = new Row($this->table
, array("id" => 3), true);
34 $this->assertTrue($row->isDirty());
39 "created" => date("Y-m-d H:i:s", strtotime("tomorrow")),
46 $this->assertFalse($row->isDirty());
49 function testGetTable() {
50 $row = new Row($this->table
);
51 $this->assertSame($this->table
, $row->getTable());