maxfilatov / phpuaca

PHPUnit Autocomplete Assistant (PhpStorm plugin)
50 stars 24 forks source link

Added completion/reference support for MockObject's 'method' calls #13

Closed King2500 closed 8 years ago

King2500 commented 8 years ago

According to the PHPUnit manual, instead of this call ...

$mock->expects($this->any())->method('method_name')->will...

... the following can be used:

$mock->method('method_name')->will...

(see https://phpunit.de/manual/5.1/en/test-doubles.html#test-doubles.stubs.examples.StubTest.php)

The method method does not actually exist (magic method), but is defined in PHPUnit_Framework_MockObject_MockObject via phpdoc. Though this is not a problem here. PhpStorm autocompletes $mock->|. The only missing glue here is support for autocomplete and reference from your plugin inside the 'method_name' parameter, which I added as FilterConfigItem.

maxfilatov commented 8 years ago

Thanks!