PHPackages                             narekps/codeception-wiremock-module - 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. narekps/codeception-wiremock-module

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

narekps/codeception-wiremock-module
===================================

Wiremock module for Codeception

1.0(3y ago)0113GPL-3.0+PHPPHP &gt;=8.0

Since Nov 30Pushed 3y agoCompare

[ Source](https://github.com/narekps/codeception-wiremock-module)[ Packagist](https://packagist.org/packages/narekps/codeception-wiremock-module)[ RSS](/packages/narekps-codeception-wiremock-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

codeception-wiremock-extension
==============================

[](#codeception-wiremock-extension)

This Codeception Extension allows developers and testers to use WireMock to mock external services when running codeception tests.

codeception-wiremock-extension connects to an already running instance of WireMock or can also run automatically a local standalone one. And, it is able to download the version of wiremock you preffer and run it too. After the tests are finished it will close the connection and turn wiremock service off (when it started it).

See also
--------

[](#see-also)

- [WireMock PHP library](https://github.com/rowanhill/wiremock-php)
- [Stubbing using WireMock](http://wiremock.org/stubbing.html)
- [Verifying using WireMock](http://wiremock.org/verifying.html)

Note
----

[](#note)

If you need an application with a functionality that is similar to the one offered by WireMock and is 100% PHP, please give Phiremock a try: [Phiremock](https://github.com/mcustiel/phiremock), it also has a nice [codeception extension](https://github.com/mcustiel/phiremock-codeception-extension).

Installation
------------

[](#installation)

### Composer:

[](#composer)

This project is published in packagist, so you just need to add it as a dependency in your composer.json:

```
$ composer require lamoda/codeception-wiremock-extension
```

Configuration Examples
----------------------

[](#configuration-examples)

### Module

[](#module)

The module allow you to connect to a WireMock instance, it can be the one ran by the extension or an already running one.

```
# acceptance.suite.yml
modules:
    enabled:
        - WireMock:
            host: my.wiremock.host # defaults to 127.0.0.1
            port: 80 # defaults to 8080
```

How to use
----------

[](#how-to-use)

### Prepare your application

[](#prepare-your-application)

First of all, configure your application so when it is being tested it will replace its external services with WireMock. For instance, if you make some requests to a REST service located under , replace that url in configuration with the url where WireMock runs, for instance: [http://localhost:8080/rest\_interface](http://localhost:8080/rest_interface).

### Write your tests

[](#write-your-tests)

```
// YourCest.php
class YourCest extends \Codeception\TestCase\Test
{
    public function _after(\AcceptanceTester $I)
    {
        $I->resetMappingsAndRequestJournalInWireMock();
    }

    // tests
    public function tryToTest(\AcceptanceTester $I)
    {
        $I->expectRequestToWireMock(
            WireMock::get(WireMock::urlEqualTo('/some/url'))
                ->willReturn(WireMock::aResponse()
                ->withHeader('Content-Type', 'text/plain')
                ->withBody('Hello world!'))
        );
        // Here you should execute your application in a way it requests wiremock. I do this directly to show it.
        $response = file_get_contents('http://localhost:18080/some/url');

        $I->assertEquals('Hello world!', $response);
        $I->receivedRequestInWireMock(
            WireMock::getRequestedFor(WireMock::urlEqualTo('/some/url'))
        );
    }

    // Also, you can access wiremock-php library directly
    public function moreComplexTest()
    {
        $wiremockPhp = Codeception\Extension\WiremockConnection::get();
        // Now you can use wiremock-php library
    }
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.1% 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

Unknown

Total

1

Last Release

1265d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/831b3039b2bc13d32be849def3eb0d6fbf4b20cd98bdb68fb9e010fbfe3b9c57?d=identicon)[narekps](/maintainers/narekps)

---

Top Contributors

[![mcustiel](https://avatars.githubusercontent.com/u/3268370?v=4)](https://github.com/mcustiel "mcustiel (18 commits)")[![Phrlog](https://avatars.githubusercontent.com/u/9060150?v=4)](https://github.com/Phrlog "Phrlog (5 commits)")[![lacoder-png](https://avatars.githubusercontent.com/u/192860877?v=4)](https://github.com/lacoder-png "lacoder-png (1 commits)")[![omnilight](https://avatars.githubusercontent.com/u/3306537?v=4)](https://github.com/omnilight "omnilight (1 commits)")[![slr42](https://avatars.githubusercontent.com/u/4040908?v=4)](https://github.com/slr42 "slr42 (1 commits)")[![dedpikhto](https://avatars.githubusercontent.com/u/3489952?v=4)](https://github.com/dedpikhto "dedpikhto (1 commits)")[![Vabogco](https://avatars.githubusercontent.com/u/51154232?v=4)](https://github.com/Vabogco "Vabogco (1 commits)")[![HaiD84](https://avatars.githubusercontent.com/u/2562280?v=4)](https://github.com/HaiD84 "HaiD84 (1 commits)")

---

Tags

codeceptionmockmodulewiremockmock external services

### Embed Badge

![Health badge](/badges/narekps-codeception-wiremock-module/health.svg)

```
[![Health](https://phpackages.com/badges/narekps-codeception-wiremock-module/health.svg)](https://phpackages.com/packages/narekps-codeception-wiremock-module)
```

###  Alternatives

[lucatume/wp-browser

A set of Codeception modules to test WordPress projects.

6343.8M153](/packages/lucatume-wp-browser)[mcustiel/codeception-http-mock

Extension for HTTP Mock.

1424.3k1](/packages/mcustiel-codeception-http-mock)[codeception/module-asserts

Codeception module containing various assertions

8550.6M1.2k](/packages/codeception-module-asserts)[codeception/lib-innerbrowser

Parent library for all Codeception framework modules and PhpBrowser

8641.7M77](/packages/codeception-lib-innerbrowser)[codeception/module-symfony

Codeception module for Symfony framework

949.4M95](/packages/codeception-module-symfony)[mcustiel/phiremock-codeception-extension

Codeception extension for Phiremock. Allows to stub remote services for HTTP requests.

311.0M5](/packages/mcustiel-phiremock-codeception-extension)

PHPackages © 2026

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