sebastianbergmann/phpunit — Issue #518: RFC: php-test-helpers support
Author: msabramo
Created: 2012-03-08 17:30:03+00:00
State: open

I just discovered [php-test-helpers](https://github.com/sebastianbergmann/php-test-helpers) and I'm wondering if it makes sense to have support in PHPUnit for it. My idea was to add code to the base test case class so that in tests, if one has php-test-helpers installed, one can provide an array or method with a list of classes to override -- e.g.:

```
$mockedClasses = array(
'Foo' => 'MockFoo',
);
```

Then the `setUp` method would automatically call `set_new_overload` to override those and the `tearDown` method would call `unset_new_overload` to unset them.

Does this sound like a good idea? If so, I can work on a pull request...