PHPackages                             timitao/behat-wiremock-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. timitao/behat-wiremock-extension

ActiveLibrary[Testing &amp; Quality](/categories/testing)

timitao/behat-wiremock-extension
================================

Behat extension for wiremock

v1.0.1(10y ago)047MITPHPPHP &gt;=5.4

Since Jun 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/timiTao/BehatWiremockExtension)[ Packagist](https://packagist.org/packages/timitao/behat-wiremock-extension)[ RSS](/packages/timitao-behat-wiremock-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Behat Wiremock Extension
========================

[](#behat-wiremock-extension)

A Behat Extension that manage over [Wiremock](http://wiremock.org) as a test for API calls.

Compatibility with Behat 3.0.\*

This extension helps configure remote server, when we need to take control over thirds part services. Over each scenario, the API will be automatically reset.

Installing extension
--------------------

[](#installing-extension)

The easiest way to install is by using [Composer](https://getcomposer.org):

```
$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar require timitao/behat-wiremock-extension='1.0.*'
```

or composer.json

```
"require": {
    "timitao/behat-wiremock-extension": "1.0.*"
},

```

Configuration
-------------

[](#configuration)

We can define services and map files by:

```
extensions:
    Behat\WiremockExtension\ServiceContainer\Extension:
        wiremock:
            services:
                  client1:
                        base_url: http://192.168.205.11
                        mappings_path: %paths.base%/data/mapping.json
                  client2:
                        base_url: http://192.168.205.12
                        mappings_path: %paths.base%/data/mapping2.json

```

Example
-------

[](#example)

Look at this [wiremock.feature](https://github.com/timiTao/BehatWiremockExtension/blob/master/features/wiremock.feature)

If you want this to test, will need recipe [Vagrant for BehatWiremockExtension](https://github.com/timiTao/VagrantBehatWiremockExtension) i tested over. Then run tests on `server` node. The IP is hard coded in recipe for test purpose.

Reset strategies
----------------

[](#reset-strategies)

### Default

[](#default)

By default, before each scenario - all services will be reset. By default it looks like:

```
Behat\WiremockExtension\ServiceContainer\Extension:
  wiremock:
    reset_strategy:
      name: always

```

### By Tags

[](#by-tags)

Second option is to manage by tags. Then config file should look like:

```
Behat\WiremockExtension\ServiceContainer\Extension:
  wiremock:
    reset_strategy:
      name: by_tags
      options:
        services:
          client1: wiremockService1Reset
          client2: wiremockService2Reset
    services:
      client1:
        base_url: http://192.168.205.11
        mappings_path: %paths.base%/data/mapping.json
      client2:
        base_url: http://192.168.205.12
        mappings_path: %paths.base%/data/mapping2.json

```

Then scenario we can manage this by:

```
Feature:
    @wiremockService1Reset
    Scenario:
        Given I send GET request to "192.168.205.11/hello/world" expect "Tests tags"

    @wiremockService2Reset
    Scenario:
        Given I send GET request to "192.168.205.12/hello/mark" expect "Tests tags 2"

```

Versioning
----------

[](#versioning)

Staring version `1.0.0`, will follow [Semantic Versioning v2.0.0](http://semver.org/spec/v2.0.0.html).

Contributors
------------

[](#contributors)

- Tomasz Kunicki [TimiTao](http://github.com/timiTao) \[lead developer\]

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Total

2

Last Release

3960d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2f588f9271b5a4b2bccdbf3c387b1769db408a23f675d83885371b0dd4bde2b?d=identicon)[timiTao](/maintainers/timiTao)

---

Top Contributors

[![timiTao](https://avatars.githubusercontent.com/u/6087694?v=4)](https://github.com/timiTao "timiTao (9 commits)")

---

Tags

behatbehat-extensionwiremock

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timitao-behat-wiremock-extension/health.svg)

```
[![Health](https://phpackages.com/badges/timitao-behat-wiremock-extension/health.svg)](https://phpackages.com/packages/timitao-behat-wiremock-extension)
```

###  Alternatives

[drupal/drupal-extension

Drupal extension for Behat

22215.1M147](/packages/drupal-drupal-extension)[friends-of-behat/variadic-extension

Variadic support for behat context arguments

2286.0M446](/packages/friends-of-behat-variadic-extension)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[imbo/behat-api-extension

API extension for Behat

1082.5M9](/packages/imbo-behat-api-extension)[drevops/behat-steps

Collection of steps for Behat

25381.7k3](/packages/drevops-behat-steps)[rstgroup/behat-oauth2-context

Behat Context for OAuth2

102.8k](/packages/rstgroup-behat-oauth2-context)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
