Skip to content

Instantly share code, notes, and snippets.

@mnapoli
Created July 1, 2016 11:36
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnapoli/34118e57c251dda947248c90eec92a37 to your computer and use it in GitHub Desktop.
Save mnapoli/34118e57c251dda947248c90eec92a37 to your computer and use it in GitHub Desktop.
PHPUnit autocompletion with PhpStorm's latest EAP
<?php
namespace PHPSTORM_META {
$STATIC_METHOD_TYPES = [
\PHPUnit_Framework_TestCase::createMock('') => [
"" == "@|PHPUnit_Framework_MockObject_MockObject",
],
\PHPUnit_Framework_TestCase::getMock('') => [
"" == "@|PHPUnit_Framework_MockObject_MockObject",
],
];
}
@mnapoli
Copy link
Author

mnapoli commented Jul 1, 2016

$logger = $this->createMock(LoggerInterface::class);

$logger is now correctly recognized as a mock object and an instance of LoggerInterface.

capture d ecran 2016-07-01 a 13 38 46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment