X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Flib%2Fpq%2FGateway%2FRowTest.php;h=c4adf8ce6a1482b041e84082bf051874e2bab073;hb=560bcb84b0fca615a86f05cd3b0ef26bf6c22ccf;hp=6a738d3b4e54dae0f58be6d3f8141c57809e101b;hpb=3c8b32baaac62855e2c9f5bfdb5ede9685ce2b76;p=m6w6%2Fpq-gateway diff --git a/tests/lib/pq/Gateway/RowTest.php b/tests/lib/pq/Gateway/RowTest.php index 6a738d3..c4adf8c 100644 --- a/tests/lib/pq/Gateway/RowTest.php +++ b/tests/lib/pq/Gateway/RowTest.php @@ -18,30 +18,29 @@ class RowTest extends \PHPUnit_Framework_TestCase { protected function setUp() { $this->conn = new \pq\Connection(PQ_TEST_DSN); - $this->conn->exec(PQ_TEST_TABLE_CREATE); - $this->conn->exec(PQ_TEST_REFTABLE_CREATE); - $this->conn->exec(PQ_TEST_DATA); + $this->conn->exec(PQ_TEST_SETUP_SQL); Table::$defaultConnection = $this->conn; $this->table = new Table("test"); $this->table->getQueryExecutor()->attach(new \QueryLogger()); } protected function tearDown() { - $this->conn->exec(PQ_TEST_REFTABLE_DROP); - $this->conn->exec(PQ_TEST_TABLE_DROP); + $this->conn->exec(PQ_TEST_TEARDOWN_SQL); } function testBasic() { $row = new Row($this->table, array("id" => 3), true); $this->assertTrue($row->isDirty()); $row->refresh(); - $this->assertSame( + $this->assertEquals( array( "id" => "3", - "created" => date("Y-m-d H:i:s", strtotime("tomorrow")), + "created" => new \pq\DateTime("tomorrow"), "counter" => "1", "number" => "1.1", - "data" => "tomorrow" + "data" => "tomorrow", + "list" => array(1,2,3), + "prop" => null ), $row->getData() );