dimanche 15 février 2015

New to dbunit with php

I just started with phpunit. Now in my project I would also like to test the methods which are interacting with the database. But I did not find a clear tutorial on how to do it.


As far I understand I first need to extend the class PHPUnit_Extensions_Database_TestCase for my test cases.


Second I need a getConnection method for creating the pdo object on which the testing will take place. Since I want to test MySQL queries how would this function look like?


Third I need to set up the newly created in memory database. But how can I do this. Does it work if I use DataSets?


Aucun commentaire:

Enregistrer un commentaire