Skip to main content

All Questions

Tagged with
2 votes
3 answers
4k views

How to use Doctrine Fixture to load test database for PHP unit testing?

I am trying to set a database environment to test my Doctrine ORM Entity classes, without changing my real database. I followed Symfony's documentation, but when I run php bin/console doctrine:...
noam's user avatar
  • 578
10 votes
3 answers
7k views

Laravel PHPUnit loading .env.testing file

I have some problems with getting Laravel to load the proper .env file for my testcases. I'm using PHPUnit with the following var set in phpunit.xml: <?xml version="1.0" encoding="UTF-8"?> &...
bsgrd's user avatar
  • 663
41 votes
10 answers
50k views

How to specify a different .env file for phpunit in Laravel 5?

I have a .env file containing my database connection details, as is normal for Laravel 5. I want to override these for testing, which I can do in phpunit.xml. However, doing this seems to go against ...
Gnuffo1's user avatar
  • 3,556
0 votes
1 answer
1k views

Ignore .env file on unit tests

Most of my classes include loading env variables for configuration. When I was coding I thought vlucas/phpdotenv ignored the .env file on testing environments since there is already a conf file like ...
Christopher Francisco's user avatar