I'm using PhpStorm 2016.2 and my code completion does not seem to work properly. When typing $this->assertCo
it suggest only function names that are up to third level ancestors of my class. But when I use Ctrl+Space it suggest correct items.
This is my class diagram:
and missing suggestions are in PHPUnit_Framework_Assert
class.
How can I make it work without using Ctrl+Space every time?
PhpStorm and OpenJDK info:
PhpStorm 2016.2
Build #PS-162.1121.38, built on July 12, 2016
JRE: 1.8.0_76-release-b216 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Reason for current behaviour: it was asked by users (WI-9403) to hide static methods when completing methods using this->
.
PHPUnit apparently has all assertXXX
methods done as static although recommends accessing them via $this->
(same way how it's done in JUnit -- the original tool where PHPUnit devs took inspiration from).
How can I make it work without using Ctrl+Space every time?
Right at the moment -- no way.
But in 2016.2.1 it will work as before for PHPUnit methods/inside PHPUnit test files (WI-32530 -- already implemented).
You may also consider voting for https://youtrack.jetbrains.com/issue/WI-32713 -- to have such behaviour completely optional (additional setting) even outside of PHPUnit tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With