CDbException :: Windows 7 64x + WAMP + PHPUnit

Hi , I’m new with Yii and need some help.

I’m testing my app but I get this Exception:

CDbException: CDbConnection failed to open the DB Connection.

This is part of my configuration file in config/main.php

‘db’=>array(

		'class'=>'CDbConnection',


		'connectionString' => 'mysql:host=localhost;dbname=yiidb',


		'emulatePrepare' => true,


		'username' => 'yiiuser',


		'password' => 'yiipass',


		'charset' => 'utf8',


	),

This is my unit test file:

class DbTest extends CTestCase

{

public function testConnection()


{


	$this->assertNotEquals(NULL,Yii::app()->db);


}	

}

I have all the requeriments installed.

I have a Windows 7 64x + WAMP 1.7.4 (PHP 5.2.5 , Apache 2.2.6 , MySql 5.0.45) , Yii 1.1.4.

Thanks for your help.

Regards,

Diego.

What about config/test.php? Check which config you specify in bootstrap.php.

/Tommy

hello,

be sure u have installed phpunit version 3.4 or higher and xdebug on ur system.

also make sure ur connection to the mysql db parameters are correct,

hint(try to use the administrator account to connect first, maybe the yiiuser account have too many restrictions )