Skip to content

SolidWorx/idea-php-phake-plugin

Folders and files

NameName
Last commit message
Last commit date
Feb 12, 2024
Apr 26, 2023
Feb 26, 2024
Apr 26, 2023
Jun 30, 2021
Apr 26, 2023
Jul 18, 2021
Jul 20, 2021
Feb 5, 2024
Jun 12, 2023
Apr 26, 2023
Jun 30, 2021
Apr 26, 2023
Jul 17, 2021
Apr 26, 2023

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