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();
}
}
It would be great if prophecies are recognized, that are defined in a parent class (e.g. in the
setUp()
method).For example: