Jump to content

PHPunit with Database


phpist

Recommended Posts

Hello all Prestashopers,

 

I'm trying to create an unit test using PHPunit framework, everything is setup well and working and I could create some simple unit tests, but when it comes to test something related to the cart/customer...etc objects, I get this errors:

PrestaShopException: Link to database cannot be established:SQLSTATE[HY000] [2002] No such file or directory

 

Even if the database info are there but somehow the PDO object throws this message, any idea please?

e.g the customer fetch:

Applications/MAMP/htdocs/presta17/classes/db/DbPDO.php:102

/Applications/MAMP/htdocs/presta17/classes/db/Db.php:323

/Applications/MAMP/htdocs/presta17/classes/db/Db.php:234

/Applications/MAMP/htdocs/presta17/config/alias.php:48

/Applications/MAMP/htdocs/presta17/config/alias.php:53

/Applications/MAMP/htdocs/presta17/classes/Configuration.php:152

/Applications/MAMP/htdocs/presta17/classes/Configuration.php:206

/Applications/MAMP/htdocs/presta17/classes/Customer.php:221

 

Thanks in advance, any info I'm ready to collaborate immediately.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...