Codeception\\Util\\Stub methods ::exactly and ::once don't work
I am using Codeception\Util\Stub to create unit tests. And I want to be sure that my method called several times. For this I am using method 'exactly'. Example: use \UnitTester; use \Codeception\Util\Stub as StubUtil; class someCest { public function testMyTest(UnitTester $I) { $stub = StubUtil::makeEmpty('myClass', [ 'myMethod' => StubUtil::exactly(2, function () { return 'returnValue'; }) ]); $stub->myMethod(); } } As you can see I called myMethod once. But test passed. The same problem with method ::once , because this method is using the same class PHPUnit_Framework_MockObject_Matcher