Stub icon indicating copy to clipboard operation
Stub copied to clipboard

Codeception\Util\Stub documentation invalid

Open mikk150 opened this issue 7 years ago • 3 comments

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

mikk150 avatar Apr 19 '17 16:04 mikk150

Please update it and make a pull request. However I advice against using Stub, use PhpUnit mocking features or any other mocking framework.

Naktibalda avatar Apr 19 '17 18:04 Naktibalda

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.

DavertMik avatar Apr 20 '17 06:04 DavertMik

I actually like Codeception Stub more than PhpUnit Mock because it is easier to use

mikk150 avatar Apr 20 '17 08:04 mikk150