public function expectCallableTwice() { $mock = $this->createCallableMock(); $mock->expects($this->exactly(2))->method('__invoke'); return $mock; }