Download the PHP package meare/codeception-mountebank without Composer
On this page you can find all versions of the php package meare/codeception-mountebank. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download meare/codeception-mountebank
More information about meare/codeception-mountebank
Files in meare/codeception-mountebank
Package codeception-mountebank
Short Description mountebank integration with Codeception
License MIT
Homepage https://github.com/meare/mountebank-codeception
Informations about the package codeception-mountebank
codeception-mountebank
codeception-mountebank provides mountebank integration with Codeception. Module allows to:
- Configure imposters required for tests run;
- Use imposters as mocks and verify specific requests were made;
- Save imposters after run for debugging purposes;
Module uses Juggler to interact with mountebank and it's possible to take complete control on mountebank in your custom helper classes or modules.
Note that only HTTP imposters are currently supported.
Install
Require module via Composer:
Configuration
Module should be enabled and configured in suite configuration file
Usage
Mock verification
mountebank should be started with --mock
flag to use mocking
Imposters mock
property should be set to true
in suite configuration. It guarantees that imposter will be restored before each test. Restoring means deleting existing imposter from mountebank and posting contract from configuration. This is done to clean requests imposter recorded.
Module provides 3 methods to verify mock imposter:
seeImposterHasRequests($alias)
Asserts that there was at least 1 request recorded on imposter
seeImposterHasRequestsByCriteria($alias, $criteria)
Asserts that there was at least 1 request that satisfies criteria recorded on imposter.
If $criteria
is array then request is considered matching if $criteria
is subarray of request, e.g.:
More complex criteria could be expressed as callback. Callback signature is:
Callback will be called for each request imposter has until true
is returned.
seeImposterHasNoRequests($alias)
Asserts that there is no requests recorded on imposter.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Credits
- Andrejs Mironovs
- All Contributors
License
The MIT License (MIT). Please see License File for more information.