Jump to content

Database connexion in a module


Recommended Posts



I have developed a module and I want to do some Unit Tests in it, using PHPUnit.


The problem is that when I try to create for example a new Customer to test the insertion, I have an error saying that the database connection failed. 


I also tried to use Db::getInstance(), with the same result. It seems that I am lacking the good method to START the connexion, since the instructions are not made from prestashop classes but from my classes extending phpUnit...


Any clue ?

Edited by ChocoSimon (see edit history)
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...