Download the PHP package mcustiel/phiremock-codeception-module without Composer

On this page you can find all versions of the php package mcustiel/phiremock-codeception-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phiremock-codeception-module

phiremock-codeception-module

This codeception module allows you to connect to a Phiremock Server and to interact with it in a semantic way through the codeception actor in your tests.

Packagist Version Build Status Scrutinizer Code Quality Packagist Downloads

Installation

Composer:

Configuration

You need to enable Phiremock module in your suite's configuration file:

Options

host

Specifies the host where phiremock-server is listening for requests.

Default: localhost

port

Specifies the port where phiremock-server is listening for requests.

Default: 8086

reset_before_each_test

Determines whether or not phiremock-server must be reset before each test.

Default: false

expectations_path

Specifies the path where expectation json files are located. The files can then be referenced using annotations and will be loaded automatically.

Default: codeception_dir/_data/phiremock-expectations

secure

A boolean specifying if the connection is secure or not. If it's secure, the request is done through https, otherwise it's done through http.

Default: false. The requests to phiremock-client are done through http.

extra_connections

An list of objects specifying the parameters to request other phiremock-servers. This is useful if you want to have 2 phiremock instances, one listening for http connections, and the other listening for https connections.

Default: An empty list, meaning that no other phiremock servers are requested.

Example

Then in the code you can use each connection by name as follows:

The default connection is called 'default' and you can also take it:

client_factory

Specifies the fully qualified class name of a class which overrides default phiremock-client factory. This is useful if you want to avoid using Guzzle HttpClient v6 (the one supported by default in phiremock-client).

Default: default

Example

The you can create a factory as follows and provide the fully qualified class name in the module configuration:

Any http client implementing psr18 can be provided.

Usage

The module provides the following handy methods to communicate with Phiremock server:

expectARequestToRemoteServiceWithAResponse

Allows you to setup an expectation in Phiremock, specifying the expected request and the response the server should give for it:

haveACleanSetupInRemoteService

Cleans the server of all configured expectations, scenarios and requests history, and reloads expectation files if they are present.

dontExpectRequestsInRemoteService

Cleans all previously configured expectations and requests history.

haveCleanScenariosInRemoteService

Cleans the state of all scenarios (sets all of them to inital state).

seeRemoteServiceReceived

Allows you to verify that the server received a request a given amount of times. This request could or not be previously set up as an expectation.

didNotReceiveRequestsInRemoteService

Resets the requests counter for the verifier in Phiremock.

grabRequestsMadeToRemoteService

Retrieves all the requests received by Phiremock server matching the one specified.

setScenarioState

Forces the state of a scenario.

takeConnection

Allows to use several connections to different phiremock servers.

@expectation Annotations

Allows you to set up an expectation via a json file

That will load by default the file at tests/_data/phiremock-expectations/get_client_timeout.json. The path where to place the expectations is configurable.

You may use expectations placed in subdirectories

Multiple annotation formats are accepted

See also:


All versions of phiremock-codeception-module with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
mcustiel/phiremock-client Version ^1.0
codeception/codeception Version ^5.0
codeception/lib-asserts Version ^1.1|^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mcustiel/phiremock-codeception-module contains the following files

Loading the files please wait ....