I was wondering if phpdoc can be used to define some object in a certain area (only inside the method) as PHPUni Mock, so in this method I can use hints like → expected, → etc., just like when you just create a layout without referring to its real class.
here is a demo:
class someTest extends PHPUnit
{
private $someMock;
public function setUp()
{
$this->someMock = $this->getMock(SomeClass::class);
}
public function testSomethingInSomeClass()
{
$a = $this->someMock->someMethodFromSomeClass();
}
private function setSomeMethodOnMock()
{
$this->someMock->....
}
}
source
share