diff --git a/tests/TestOfDAOFactory.php b/tests/TestOfDAOFactory.php index 88e9c12505..c9109caf08 100644 --- a/tests/TestOfDAOFactory.php +++ b/tests/TestOfDAOFactory.php @@ -51,8 +51,8 @@ protected function buildData() { 'test_id int(11),' . 'unique key test_id_idx (test_id)' . ')'; - if ($this->testdb_helper->prefix != 'tu_') { - $test_table_sql = str_replace('tu_', $this->testdb_helper->prefix, $test_table_sql); + if (ThinkUpTestDatabaseHelper::$prefix != 'tu_') { + $test_table_sql = str_replace('tu_', ThinkUpTestDatabaseHelper::$prefix, $test_table_sql); } $this->testdb_helper->runSQL($test_table_sql); @@ -190,7 +190,7 @@ public function testGetOwnerDAO(){ public function testGetOwnerDAONoConfigFile(){ $this->removeConfigFile(); Config::destroyInstance(); - $cfg_values = array("table_prefix"=>$this->testdb_helper->prefix, "db_host"=>"localhost"); + $cfg_values = array("table_prefix"=>ThinkUpTestDatabaseHelper::$prefix, "db_host"=>"localhost"); $config = Config::getInstance($cfg_values); $dao = DAOFactory::getDAO('OwnerDAO', $cfg_values); $this->assertTrue(isset($dao)); @@ -381,7 +381,7 @@ public function testGetShortLinkDAO() { public function testGetInstallerDAONoConfigFile(){ $this->removeConfigFile(); Config::destroyInstance(); - $cfg_values = array("table_prefix"=>$this->testdb_helper->prefix, "db_host"=>"localhost"); + $cfg_values = array("table_prefix"=>ThinkUpTestDatabaseHelper::$prefix, "db_host"=>"localhost"); $config = Config::getInstance($cfg_values); $dao = DAOFactory::getDAO('InstallerDAO', $cfg_values); $this->assertTrue(isset($dao)); diff --git a/tests/classes/class.ThinkUpUnitTestCase.php b/tests/classes/class.ThinkUpUnitTestCase.php index 7bfb68646a..76a09c130c 100644 --- a/tests/classes/class.ThinkUpUnitTestCase.php +++ b/tests/classes/class.ThinkUpUnitTestCase.php @@ -63,7 +63,6 @@ public function setUp() { $this->testdb_helper = new ThinkUpTestDatabaseHelper(); $this->testdb_helper->drop($this->test_database_name); $this->table_prefix = $config->getValue('table_prefix'); - $this->testdb_helper->prefix = $this->table_prefix; $this->testdb_helper->create($THINKUP_CFG['source_root_path']."/webapp/install/sql/build-db_mysql.sql"); }