2

How i can accept all parameters in function mock with #phpspec2?

for example i have code like this:

$em->persist($entity)->willReturn(true);

I don't want mock all possible parameters, it should accept every entity.

Paweł Mikołajczuk
  • 3,692
  • 25
  • 32

1 Answers1

1

You can use Argument class and any method/function:

use Prophecy\Argument;
...
Argument::any()

Here you can find more details about this.

takeit
  • 3,991
  • 1
  • 20
  • 36