I have a PHPUnit test testFoo()
with a dataProvider fooProvider()
. At the beginning of testFoo()
I'm using Runkit to redefine a method so I can test expected results when that method is returning what I've redefined it to return. However, redefining the method is a little time-intensive, so I'd like for it to only happen once for this test.
Does the PHPUnit framework provide functionality to specify code that I'd like to run just once before testFoo()
runs and not once for each element returned by fooProvider()
or once per test in the suite (as with setUp()
)?