class ExactlyTest extends TestCase
public function testCounterCall() : void
$counter = $this->getMockBuilder(Counter::CLASS)
// a 4th call of increment() is not allowed by this test
private $count = 0;
public function increment()
Time: 00:00.026, Memory: 18.00 MB
There was 1 failure:
Counter::increment() was not expected to be called more than 3 times.
Tests: 1, Assertions: 0, Failures: 1.