Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autocomplete for variables initialized in setUp() #15

Open
patkoscsaba opened this issue Feb 4, 2016 · 2 comments
Open

Add autocomplete for variables initialized in setUp() #15

patkoscsaba opened this issue Feb 4, 2016 · 2 comments

Comments

@patkoscsaba
Copy link

Add autocomplete for class variables initialized in setUp() similar to the ones initialized in __construct().

Example:

class someTest extends .... {

private $var;

function setUp() {
$this->var = new SomeClass();
}

function testSomething() {
$this->var->[expect autocomplete here with the methods of SomeClass]
}
}

@mdio
Copy link

mdio commented Feb 24, 2016

I'm doing the same right now, but with proper annotations:

class MyTest extends TestCase {
    /**
     * @var ObjectProphecy|MyOtherClass
     */
    private $otherClass;

    protected function setUp() {
        $this->otherClass = $this->prophesize(MyOtherClass::class);
    }

    public function testStuff() {
        $this->otherClass->someMethod()->willReturn(42);
    }
}

It still doesn't work. ->willReturn() is "not found in class MyOtherClass" by PhpStorm.
Is it safe to assume that this will be implemented together with issue #9?

@srosato
Copy link

srosato commented Sep 14, 2016

I am looking forward for this too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants