I’m trying to setup a testing server on my local box so I have Yii and MAMP installed. My actual main.php has
'db' => array(
'connectionString' => 'mysql:host=123.123.166.77;dbname=hch_dev',
'emulatePrepare' => true,
'username' => 'dev_user',
'password' => 'password',
'charset' => 'utf8',
'tablePrefix' => '3hch_',
),
which is an external dev server. I want PHPUnit to perform on a local MAMP MySQL server so in test.php I have
return CMap::mergeArray(
require(dirname(__FILE__).'/main.php'),
array(
'components'=>array(
'fixture'=>array(
'class'=>'system.test.CDbFixtureManager',
),
'db' => array(
'connectionString' => 'mysql:localhost;dbname=hch_test',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'pw',
'charset' => 'utf8',
'tablePrefix' => '3hch_',
),
),
)
);
when running the Unit tests on the external server all is well, as soon as I put in the local testing server I get an errors such as
CDbException : The table "{{news}}" for active record class "News" cannot be found in the database.
Why would this be? The tables are created in both databases…