Skip to content

Commit

Permalink
Add test for @return $this phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
halftan committed Jan 9, 2017
1 parent 4b5594f commit 6c22a14
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions features/class-scope-completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,89 @@ Feature: Class Scope
| aPublicProperty |
| methodOfOtherClass |
| otherMethodOfOtherClass |

Scenario: Gettings all methods and properties for $this with @return $this
Given there is a file with:
"""
<?php
class SomeClass
{
/**
* @return $this
*/
public function method1()
{
}
public function method2()
{
}
private function somePrivateMethod()
{
}
private $someDep;
public $someApi;
}
"""
When I type "$this->method1()->" on the 18 line
And I ask for completion
Then I should get:
| Name |
| method1 |
| method2 |
| someApi |

Scenario: Accessing only public methods and properties for return $this
Given there is a file with:
"""
<?php
class SomeOtherClass
{
public function methodOfOtherClass()
{
}
public function otherMethodOfOtherClass()
{
}
private function privateMethodOfOtherClass()
{
}
public $aPublicProperty;
}
class SomeClass
{
/**
* @return $this
*/
public function method1()
{
}
public function method2()
{
}
private function somePrivateMethod()
{
}
private $someDep;
public $someApi;
}
"""
When I type "$a = new SomeClass;" on the 15 line
And I type "$a->method1()->" on the 16 line
And I ask for completion
Then I should get:
| Name |
| method1 |
| method2 |
| someApi |

0 comments on commit 6c22a14

Please sign in to comment.