Lol, ok … seems that it already uses the test database for retrieving the datasets from the database …
The problem is, that it creates the database entry in the "dev" database instead of the "test" database (the user interaction leads to the "actionCreate", which points to the "dev" database instead of the "test" database)
–> how can I make it write to the "test" database should be the correct question.
Thanks for your reply, but that’s what I actualy do right now. Like i sayed, when I call a function in a model from a selenium test file it uses the test database. But when I call a website (with index-test.php instead of index.php) it seems to always use the “dev” database.
My test.php looks as follows:
require(dirname(__FILE__) . '/main.php'),
'components' => array(
'fixture' => array(
'class' => 'system.test.CDbFixtureManager',
/* uncomment the following to provide test database connection
'connectionString'=>'DSN for test database',
'db' => array(
'connectionString' => 'mysql:host=127.0.0.1;dbname=startregie_test',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
/*'tablePrefix' => 'tbl_',*/
And my index-test.php:
// change the following paths if necessary
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
Finally the use of “createUrl()” didn’t solve anything, but setting showScriptName to true did the work. Maybe someone could explain to me, why this did the job? I’d like to understand, why it didn’t work in first place?
… and I just can repeat myself: I f***ing LOVE Yii! Great job guys!