PHPStorm plugin for the Phake mocking framework to allow autocompletion for stubs and mocks. This plugin supports Phake version 3 and 4.
When creating mock objects using Phake::mock()
, you can get autocomplete results for the object that is being mocked.
PHPStorm will see the variable returned from the mock()
call to be an instance of the actual class being mocked, which means no more inspections about incomatible types.
Using Phake::when
, you can get autocomplete results for the mocked class, so that you don't have to copy-paste method names or manually type them, and ensure there are no typo's in the method names.
When stubbing method calls, you can get autocomplete results for the stubber proxy value to determine the return value for the method call.
Calls to Phake::verify
will return autocomplete results for the mocked class to ensure you can quickly choose the correct method name.
When you refactor any method name, all the corresponding methods will automatically be updated iin the mocks you use, so you never have to manually update your methods stubs again.
PHPStorm can correctly resolve all the symbols in the mocks, letting you click through to the specific methods.