/** @test */ public function method_times_shouldCallWithIndex() { Fn\times(3, $spy = new Spy()); $spy->shouldHaveBeenCalled()->with(0); $spy->shouldHaveBeenCalled()->with(1); $spy->shouldHaveBeenCalled()->with(2); }
/** * @test * @expectedException \Mockery\Exception\InvalidCountException */ public function shouldHaveBeenCalled_shouldFailIfTheSpyWasCalled_withWrongArgs() { $spy = new Spy(); $spy('foo'); $spy->shouldHaveBeenCalled()->with('bar'); }