Jump to content


DBConnection error while using PHPUnit

Mysql MAC OS DBConnection PHPUNit

  • Please log in to reply
2 replies to this topic

#1 ibr



  • New Members
  • Pip
  • 5 posts

Posted 05 January 2013 - 09:45 AM

After following the steps to install Zurmo on MAC OS and creating two database accounts, the system worked perfectly using the browser. However, I am not able to perform unit tests using PHPUnit.
I have set the parameters in perInstanceTest.php and when running this command:
>>phpunit TestSuite.php All

I receive the following error:

Fatal error: Uncaught exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in /Library/WebServer/Documents/projects/zurmo/yii/framework/db/CDbConnection.php:382

I have tested successfully the PDO and MySQL settings using couple of examples from http://php.net/manua...connections.php


Trying another test like >> phpunit PDOTest.php
I receive this error:
Fatal error: Class 'BaseTest' not found in /Library/WebServer/Documents/projects/zurmo/app/protected/tests/unit/PDOTest.php on line 29

I have no clue what could be the problem, specially that the Web application is working without any problem.

Thank you for helping

#2 ibr



  • New Members
  • Pip
  • 5 posts

Posted 05 January 2013 - 10:11 PM

Problem solved. The issue was that php cli was using different settings than php.ini, and that is why it worked perfectly using the browser and not with the command line.

#3 Jason



  • Administrators
  • 864 posts
  • LocationChicago

Posted 05 January 2013 - 11:44 PM

Glad you figured it out!

Jason Green
Zurmo Team
Need support? Upgrade now

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users