autoload; cache; tests;
[m6w6/pq-gateway] / tests / lib / pq / Gateway / RowsetTest.php
index 7ef1a0eb21721a374ba36b41c59108197b08b387..48ac624574615cc366a655835c34cfc56350b72e 100644 (file)
@@ -17,16 +17,17 @@ class RowsetTest 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);
        }
 
        public function test__invoke() {