Testing defines in PHPUnit

This one tripped me up recently. Say you are wanting to test a bit of code using PHPunit that relies on a defined constant. You don't want the define() to affect your other tests, you only want it to apply for this specific test. Something like this: class MyTest extends PHPUnit_Framework_TestCase { public function testExample()…

Continue reading Testing defines in PHPUnit