idea-php-phpunit-plugin
idea-php-phpunit-plugin copied to clipboard
Prophecy support for inherited classes
It would be great if prophecies are recognized, that are defined in a parent class (e.g. in the setUp()
method).
For example:
class TheParentTest extends \PHPUnit\Framework\TestCase
{
/**
* @var \Prophecy\Prophecy\ObjectProphecy|TheProphesizedClass
*/
protected $myProphecy;
public function setUp()
{
$this->myProphecy = $this->prophesize(TheProphesizedClass::class);
}
/**
* @test
*/
public function someTest()
{
// This works fine
$this->myProphecy->someMethod()->shouldBeCalled();
}
}
class TheTest extends TheParentTest
{
/**
* @test
*/
public function someTest()
{
// This causes an IDE warning.
$this->myProphecy->someMethod()->shouldBeCalled();
}
}
+1 Just wanted to open the same issue, this feature would be awesome. @Haehnchen any plans?
indeed good idea, possible but not that easy to implement, will think about it