Stub
Stub copied to clipboard
Codeception\Util\Stub documentation invalid
Codeception\Util\Stub::atLeastOnce()
, Codeception\Util\Stub::exactly()
, Codeception\Util\Stub::never()
, Codeception\Util\Stub::once()
examples do not show, that in order for those methods to work, you have to insert \Codeception\Test\Unit
Please update it and make a pull request. However I advice against using Stub, use PhpUnit mocking features or any other mocking framework.
I think it was a mistake to accept PR which adds mocking into Stub class. Stub should make stubs only, everything other is evil :imp: Use proper mocking framework for mocks.
I actually like Codeception Stub more than PhpUnit Mock because it is easier to use