Skip to content

SolidWorx/idea-php-phake-plugin

Repository files navigation

PHPStorm Phake Plugin

Build Version Downloads

PHPStorm plugin for the Phake mocking framework to allow autocompletion for stubs and mocks. This plugin supports Phake version 3 and 4.

Features

Autocomplete for mock objects

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.

Screenshot 2021-07-17 at 17 13 29

Autocomplete for method stub

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.

Screenshot 2021-07-17 at 17 13 50

Autocomplete for stub return calls

When stubbing method calls, you can get autocomplete results for the stubber proxy value to determine the return value for the method call.

Screenshot 2021-07-17 at 17 14 02

Autocomplete for verification methods

Calls to Phake::verify will return autocomplete results for the mocked class to ensure you can quickly choose the correct method name.

Screenshot 2021-07-17 at 17 14 58

Refactor methods will update the mocked classes

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.

Kapture 2021-07-18 at 09 01 05

Resolving symbols

PHPStorm can correctly resolve all the symbols in the mocks, letting you click through to the specific methods.

Kapture 2021-07-18 at 09 04 21

About

IntelliJ IDEA / PhpStorm Plugin for Phake mocking framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages