Fed03's avatar

Using PHPSpec to test repositories in L5

Hi all, I've a bunch of eloquent repositories I want to test.

With Laravel4 and PHPUnit I used to have a database config file for the testing environment with an sqlite in memory database. Then with the aid of testdummy I was able to test my repositories.

Now I switched to PHPSpec and L5 and I don't have any idea on how to reproduce that workflow, so I'm here to ask for your help XD

Thank you in advance

0 likes
3 replies
JeffreyWay's avatar

PHPSpec doesn't entirely take the place of PHPUnit. If you're testing repositories that use Eloquent, use PHPUnit.

Fed03's avatar

@JeffreyWay Fair enough, but remains the problem of using a different db for the testing environment...I don't know how to do it

Thank you, Jeff

JeffreyWay's avatar

@Fed03 - Within your php.xml file, at the bottom, you can set custom environment vars. Then, just pick that up from your database/config.php file.

Please or to participate in this conversation.