On 8/16/17 3:02 PM, Ryan Jentzsch wrote:
> I am aware of Advanced PHP debugger but what I need this type of
> functionality for is mocking and testing.
If you're using namespaces you can try overriding the built-in functions
that way. I've done this successfully in my own library for mocking ldap
and imap function calls (https://git.io/v7ALm)
Original post about the idea.
http://www.manuel-strehl.de/dev/overwrite_PHP_built-in_functions.en.html
> As an example I want to use PHPUnit mocking feature to create a mock
> of a class. However in the constructor of this class is the following
> line to get the expected JSON string:
There is the php-mock library, which appears to have integration for
PHPUnit, Mockery, and Prophecy. I can't vouch for it as I've not used it
yet.
https://github.com/php-mock/php-mock
Dave
--
David Lundgren
dlundgren@syberisle.net
GPG: 0x26F54D7F