You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finds all private properties which are initialized in constructor
Adds them to constructor with prophesize accordingly their classes from doc block
Use case:
When a test needs several more mocks which are not a part of subject constructor calls, developer could just add private properties and generate all prophesies by this magic feature
The text was updated successfully, but these errors were encountered:
Good idea in general. My thoughts on this were slightly different.
I thought about adding another intention you trigger manually from any part in the test (setUp() or testMethod()). You then get to choose the interface or class from the known "Import class" popup. If you confirm an interface or class, the intention will
add the chosen interface to the imports (if not present) like: use Fully\Qualified\Namespace\ChosenInterface;
create a new prophecy at the cursor like: $this->chosenInterface = $this->prophesize(ChosenInterface::class);
add a new member variable to the test like: private $chosenInterface;
add a doc-block for this member like: /** @var ChosenInterface|ObjectProphecy */
Additional helper would be great, which:
prophesize
accordingly their classes from doc blockUse case:
When a test needs several more mocks which are not a part of subject constructor calls, developer could just add private properties and generate all prophesies by this magic feature
The text was updated successfully, but these errors were encountered: