rtens/mockster — pull request #4 by jwoschitz (2014-04-10 17:44:16+00:00)
Title: Extracted method mocking in separate class, exposed methods with fluid interface

The main objective of this change request was to expose the methods of a Mockster object to apply convenient batch operations to a mock.

Example:
```
// will be applied to all public and protected methods in instance::class
$instance->__mock()->methods()->willCall(function() {
throw new \Exception('Not implemented');
})

// also filtering is possible
$instance->__mock()->methods()->filter(Mockster::F_PROTECTED)->dontMock();
```
This request contains several changes:
- extracted the filter callback as a separate class and added tests for it
- replaced the stubs array with a StubsRegistry class to be able to pass it by reference conviently (and also to have some convience functions available)
- extracted the access to methods to MethodCollection and added a fluid interface to Mockster to access the collection

All changes are b/c. There is one failing test but this was failing even before, this test fails due to this issue https://github.com/watoki/factory/issues/1.