Hi, all
I am new to this framework, I have been following this book to get me started. However, I have run into this problem in Chapter 4 when I tried to test my database connection.
Output from the console:
There was 1 error:
1) DbTest::testConnection
CDbException: CDbConnection failed to open the DB connection.
/Applications/XAMPP/xamppfiles/htdocs/yii/framework/db/CDbConnection.php:388
/Applications/XAMPP/xamppfiles/htdocs/yii/framework/db/CDbConnection.php:331
/Applications/XAMPP/xamppfiles/htdocs/yii/framework/db/CDbConnection.php:309
/Applications/XAMPP/xamppfiles/htdocs/yii/framework/base/CModule.php:388
/Applications/XAMPP/xamppfiles/htdocs/yii/framework/base/CModule.php:104
/Applications/XAMPP/xamppfiles/htdocs/trackstar/protected/tests/unit/DbTest.php:5
/usr/bin/phpunit:46
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
I strictly followed the steps in the book, and I tried both main.php and test.php, they both did not work as expected. Can anyone help me? I am driving crazy…
Note: Even if I use the default sqllite configuration, when I changed the name of the .db file, it still passed the test! What on earth is going on here???