autoload; cache; tests;
[m6w6/pq-gateway] / tests / lib / pq / Gateway / RowTest.php
index 28d2728c006817ad09e59470d492ed8abf93d666..fc0809468ea0a7aa2f804de834263ab8c410e5ab 100644 (file)
@@ -17,16 +17,17 @@ class RowTest extends \PHPUnit_Framework_TestCase {
        protected $table;
 
        protected function setUp() {
-               $this->conn = new \pq\Connection(PQ_DSN);
-               $this->conn->exec(PQ_TEST_DROP_TABLE);
-               $this->conn->exec(PQ_TEST_CREATE_TABLE);
-               $this->conn->exec(PQ_TEST_CREATE_DATA);
-               
-               $this->table = new Table(PQ_TEST_TABLE_NAME, $this->conn);
+               $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);
+               Table::$defaultConnection = $this->conn;
+               $this->table = new Table("test");
        }
 
        protected function tearDown() {
-               $this->conn->exec(PQ_TEST_DROP_TABLE);
+               $this->conn->exec(PQ_TEST_REFTABLE_DROP);
+               $this->conn->exec(PQ_TEST_TABLE_DROP);
        }
 
        function testBasic() {