Giter VIP home page Giter VIP logo

phiremock's Introduction

Phiremock Bundle

Phiremock is a mocker and stubber of HTTP services, it allows software developers to mock HTTP requests and setup responses to avoid calling real services during development, and is particulary useful during acceptance testing when expected http requests can be mocked and verified. Any HTTP service (i.e.: REST services) can be mocked and stubbed with Phiremock. Phiremock is heavily inspired by WireMock, but does not force you to have a java installation in your PHP development environment. The full functionality of Phiremock is detailed in the following list:

  • Allows to mock http request based in method, headers, url and body content.
  • Allows to match expectations using regexp patterns or equality.
  • REST interface to setup.
  • Stateful and stateless mocking.
  • Network latency simulation.
  • Priorizable expectations for cases in which more than one matches the request. If more than one expectation matches the request and no priorities were set, the first match is returned.
  • Allows to verify the amount of times a request was done.
  • Allows to load default expectations from json files in a directory tree.
  • Proxy requests to another URL as they are received.
  • Client with fluent interface to configure Phiremock.
  • Integration to codeception through phiremock-codeception-extension and phiremock-codeception-module.
  • Fill the response body using data from the request.

Latest Stable Version Monthly Downloads

Note: In version 2 Phiremock has separated libraries for the server and the client. This repository became the bundle for both libraries.

Installation

Composer:

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

    "require-dev": {
        "mcustiel/phiremock": "v2.0",
        "guzzlehttp/guzzle": "^6.0"
    }

See

Thanks to:

And everyone who submitted their Pull Requests.

phiremock's People

Contributors

alexstansfield avatar arnaudlabenne avatar buflix avatar danielnoga avatar drudoi avatar gounlaf avatar kaelenproctor avatar linslin avatar mcustiel avatar mrincompetent avatar nuzzio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phiremock's Issues

Reason for limit Codeception to Codeception 2.xx

Hello my friend,

is there any reason to lock this plugin to Version 2.xx of Codeception?
Just asking because i wanted to use the latest stable codeception version, but that limit interrupts my plans.

PCNTL constants on Windows breaking my test enviromnent

Hey m8,

you are using PCNTL constants which are not working on Windows. This is breaking my test enviromnent at this moment.

File: PhiremockProccess.php

    /**
     * Stops the process.
     */
    public function stop()
    {
        $this->process->signal(SIGTERM);
        $this->process->stop(3, SIGKILL);
    }

How to mock a response from a third party api

Hi,

I am looking for a tool to do snapshot testing for third-party APIs, for example https://graph.facebook.com or Google Ad API.

I managed to install and configure Phiremock in a project and added an expectation, which I can get by using Insomnia as a client.

Now, I was trying to set up Phiremox with the Codeception module using the same expectation, but I failed to get it to run.

My use-case is as follows:

  1. I have a class which makes several API calls to, for example, graph.facebook.com through Facebook Business SDK Library.
  2. I want to use snapshot testing to record (or prepare) the responses from the API so that I can use them in acceptance tests without calling the external API.
  3. In the acceptance test, I initialize a Phiremock client and set it to connect to my Phiremock server.
  4. I run the method which calls the external API and I expect Phiremock to somehow hijack that call and give the expectation as response.

Am I right to think that Phiremock can do this?
If so, can you point me in the right direction to achieve this?

I guess point 4 is my problem, as I hope that Phiremock magically hijacks the call. Regrettably, I have tried to find out how to make this work, but I haven't been able to.

I have tried using

url": {
      "isEqualTo": "https://graph.facebook.com/v10.0/act_866830094136812/campaigns"
    },

to set the URL in the expectation

If I set it to

url": {
      "isEqualTo": "/act_866830094136812/campaigns"
    },

I can get the expectation with a call to localhost:8086/act_866830094136812/campaignsfrom Insomnia.

In the Test I initialize a client by using

$phiremockClient = PhiremockClientFactory::createDefault()->createPhiremockClient(
            new Host('localhost'),
            new Port('8086')
        );

but then, after reading all I could find, I don't know how to move forward.

I will appreciate any pointers and any help :)

Best,

Diego

Switch to MIT/BSD/Apache license?

Could it be an option to switch phiremock and phiremock-codeception to a not so strict license regarding code publish when distributing the software, e.g. MIT, BSD or Apache?

"Syntax error" during expectation creation when adding binary body to ResponseBuilder

I found the issue during expectation creation when I tried to add a binary data from image:

$expectation = Phiremock::on(
    A::getRequest()
        ->andUrl(Is::equalTo('/test_images/image1.jpg'))
)->then(
    Respond::withStatusCode(200)
        ->andBody(file_get_contents($testDataPath.'test_images/image1.jpg'))
        ->andDelayInMillis(2000)
);

Package versions:

mcustiel/creature                        v2.0.0
mcustiel/mockable-datetime               1.0.0
mcustiel/phiremock                       v1.7.1
mcustiel/phiremock-codeception-extension dev-master e52996c
mcustiel/php-simple-di                   1.2.1
mcustiel/php-simple-request              v3.1.0
mcustiel/power-route                     v3.0.0

Error:

An error occurred creating the expectation: Syntax error
.../vendor/mcustiel/phiremock/src/Client/Phiremock.php:281
.../vendor/mcustiel/phiremock/src/Client/Phiremock.php:269
.../vendor/mcustiel/phiremock/src/Client/Phiremock.php:74
.../vendor/mcustiel/phiremock-codeception-extension/src/Module/Phiremock.php:59

[Request] Split packages

Hi,

Could you consider to provide phiremock in different packages... at least phiremock-client and phiremock-server?

It would reduce dependencies when using the "client" part on a project.

Thanks,

Regards.

Symfony4 (in)compatibility

Phiremock v1.8.0 requires symfony/cache in ^3.1 so when I want to install it in SF4 project it rises error: "Your requirements could not be resolved to an installable set of packages".

Support Patch requests

Hi, This library is great, thanks!

However, while I was writing some tests, I was trying to mock a request with the HTTP verb PATCH but unfortunately phiremock doesn't seem to support this verb. The A:: class doesn't have the method: patchRequest which then I'm unable to mock the call.

Do you have any workaround on this?
Do you plan to support PATCH HTTP verb as it commonly used in REST to update partially resources?

Thanks a lot!

Matching by sameJsonObjectAs does not work correctly

Hi,
I have tested new feature Is::sameJsonObjectAs. I have found that matching does not work correctly when similar request are made.

Lets have two POST requests with following jsons:
{ "foo": "1"} and { "foo": "1", "bar": "2"}.

When writing expectation like: A::postRequest()->andUrl(Is::equalTo("/api"))->andBody(Is::sameJsonObjectAs('{ "foo": "1", "bar": "2"}'));

The expectation always return me two matches. It should return one match.

Mock endpoint with query string doesn't match

Hi again, thanks a lot for this awesome library.

I came across a weird behavior, which I don't understand if it was by design or if it is a bug, please advise.

In my code I'm making a call to
GET /users?filters[id][0]=1&filters[id][1]=2&filters[id][3]=3

in my test, I'm trying to create an endpoint to phiremock that match exactly that url + querystring

ex:

$this->phiremock->expectARequestToRemoteServiceWithAResponse(
	Phiremock::on(
        A::getRequest()
		->andUrl(Is::equalTo('/users?filters[id][0]=1&filters[id][1]=2&filters[id][3]=3'))
	)->then(
		Respond::withStatusCode($this->status_code);
	)
);

The call fails, not matching the Phiremock endpoint if I instead don't assert the query string and use only Is::equalTo('/users') that works.

My expectation was to see it pass if the url fully matches.

Any thoughts? ๐Ÿ‘

Native JSON body support in expectation file

I propose to support not stings only in request body, but native JSON too. It much easier to define, verify and looks good in IDE with JSON highlight. It's very hard to keep actual big JSON responses if they are already encoded, so I tried to improve it.

In current implementation JSON body is defined in the next way:

    "request": {
        "method": "GET",
        "url": {
            "isEqualTo" : "/example_service/some/resource"
        }
    },
    "response": {
        "statusCode": 200,
        "body": "{\"id\": 1, \"description\": \"I am a resource\"}"
    }

As you see you should escape quotes and it is not formatted.

I propose to support this definition.

    "request": {
        "method": "GET",
        "url": {
            "isEqualTo" : "/example_service/some/resource"
        }
    },
    "response": {
        "statusCode": 200,
        "body": {
            "id": 1, 
            "description": "I am a resource"
        }
    }

Mcustiel\Phiremock\Client\Phiremock\createExpectation falls in timeout

Hi,

I use Phiremock with the extension for codeception. When I create the same expectation a few times (about 15), the test command freezes.

After some debugging, I found out that the request created in Mcustiel\Phiremock\Client\Phiremock\createExpectation sometimes falls in timeout. I tried to add a timeout option to the Guzzle client, but it stills freeze.

Do you know how I can get some more information about this for debugging ? It seems that it is caused by the phiremock CLI that does not respond after a few calls to its api.

The bin/phiremock file uses Monolog, but where does Monolog writes its logs ?

"matches" operator in URL condition breaks responce body

Using "matches" operator for URL I have unexpecred response.

For this expectation:

{
  "request": {
    "method": "GET",
    "url": {
      "matches": "~/hello~"
    }
  },
  "response": {
    "statusCode": 200,
    "body": "Hello!"
  }
}

I have the next result:

$ curl http://localhost:8086/hello
http://localhost:8086Hello!

And if the condition is strict (otherwise it seen on any match, for /i/dont/want/hello too)

{
  "request": {
    "method": "GET",
    "url": {
      "matches": "~^/hello$~"
    }
  },
  "response": {
    "statusCode": 200,
    "body": "Hello!"
  }
}

I see the next:

$ curl http://localhost:8086/hello
http://localhost:8086/hello

It happens because of replacement in \Mcustiel\Phiremock\Server\Utils\Strategies\RegexResponseStrategy:

    private function fillWithUrlMatches($expectation, $httpRequest, $responseBody)
    {
        if ($this->urlConditionIsRegex($expectation)) {
            $responseBody = preg_replace('/\$\{url\.(\d+)\}/', '\$$1', $responseBody);

            return preg_replace(
                $expectation->getRequest()->getUrl()->getValue(),
                $responseBody,
                $httpRequest->getUri()->__toString()
            );
        }

        return $responseBody;
    }

Here $expectation->getRequest()->getUrl()->getValue() is "~/hello~", $responseBody is "Hello!", and $httpRequest->getUri()->__toString() is "http://localhost:8086/hello". The last value adds missmatch with search argument in response, and outputs if the condition isn't matches.

I don't know how to fix it in the best way, I'll think about it tommorow. I'll be happy to see ideas in comments.

Shorter syntax to create simple expectation (suggestion)

First, I'd like to say thank you for this library!

The only annoyance I'm having at the moment is that it's a bit awkward to create a simple expectation, and the tests I write end up to be hard to read because of this.

So I'd like to suggest a shortcut for simple use cases, something like:

$phiremock->on('GET','/my/url')->then(200, $content); 
  1. on() is not static anymore (one can always call new ExpectationBuilder manually if necessary)
  2. on() can either take a RequestBuilder (unchanged behavior) or 2 strings, in which case it builds RequestBuilder::create($param1)->andUrl(Is::EqualTo($param2)) by default
  3. then() can either take a ResponseBuilder (unchanged behavior) or 2 strings, in which case it builds Respond::withStatusCode($param1)->andBody($param2)

This way it would take 1 line to write expectation for common use cases instead of the 8-10 needed at the moment.

What do you think? Is it something you would consider accepting as a PR?

Comparing request data structures

We need to make expectations for explicit JSON structures, but:

  • we want whitespaces to be ignored
  • don't want to write complex regexes

In other words, we would like to match that, for example, this was sent through request:
{"name": "John", "surname": "Deer", "tags": ["a", "b"]}

even if it was sent in pretty format:

{
    "name": "John",
    "surname": "Deer",
    "tags": ["a", "b"]
}

or condensed:
{"name":"John","surname":"Deer","tags":"a","b"]}
or even in different order:
{"name": "John", "tags": ["a", "b"], "surname": "Deer"}

Recursivity should be supported.

List all expectations failed with annotation not found error

As documentation says expactations list is got with:

    use Mcustiel\Phiremock\Client\Phiremock;

    $phiremock = new Phiremock('phiremock.server', '8080');
    $expectations = $phiremock->listExpectations();

But this code failes with

[Doctrine\Common\Annotations\AnnotationException] [Semantical Error] The annotation "@Mcustiel\SimpleRequest\Annotation\Validator\NotNull" in property Mcustiel\Phiremock\Domain\Expectation::$request does not exist, or could not be auto-loaded.

This is because auto-loader is not registered in Doctrine\Common\Annotations\AnnotationRegistry.

Tests are green because the loader is registered in _bootstrap.php. I think that annotations should be registered in the box, and Client construct should be enough.

minimum-stability suggestion

Hi, first off great library!

I'd like to point out that setting minimum-stability to dev without adding prefer-stable true is very risky. All dependencies of the composer.json will then be loaded under dev stability, instead of possible stable.

Support of reactphp/http in newest version(v0.8.3)

I'm using newest version of reactphp/http(v0.8.3) but your project is locked on 0.7.x version and because of that I can't use it. I'm using features from 0.8 version so I can't downgrade that library.

Could you update your project to 0.8.x version?

Regards,
Kordos

[Bug] Strange bug with PHAR versions

Hi,

I've a strange issue (see trace below); so digging and reading trace, method Mcustiel\Phiremock\Domain\Expectation::setRequest($request) and Mcustiel\Phiremock\Domain\Expectation::setResponse($response) receive array instead of \Mcustiel\Phiremock\Domain\Request and \Mcustiel\Phiremock\Domain\Response.

I haven't dig deeper right now (but will try to debug...)

To have more context, you can check it here

[2019-03-20 22:41:50] stdoutLogger.INFO: Starting Phiremock... [] []
[2019-03-20 22:41:50] stdoutLogger.INFO: Phiremock http server listening on 0.0.0.0:8080 [] []
PHP Fatal error:  Method Mcustiel\Phiremock\Domain\Expectation::__toString() must not throw an exception, caught Error: Call to a member function __toString() on array in phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/Base/AbstractRequestAction.php on line 0
PHP Stack trace:
PHP   1. {main}() /Users/florianlevis/phiremock.phar:0
PHP   2. require() /Users/florianlevis/phiremock.phar:10
PHP   3. require() phar:///Users/florianlevis/phiremock.phar/bin/phiremock:3
PHP   4. Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer->listen() phar:///Users/florianlevis/phiremock.phar/bin/phiremock.php:81
PHP   5. React\EventLoop\StreamSelectLoop->run() phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:102
PHP   6. React\EventLoop\StreamSelectLoop->waitForStreamActivity() phar:///Users/florianlevis/phiremock.phar/vendor/react/event-loop/src/StreamSelectLoop.php:211
PHP   7. React\Stream\DuplexResourceStream->handleData() phar:///Users/florianlevis/phiremock.phar/vendor/react/event-loop/src/StreamSelectLoop.php:244
PHP   8. React\Stream\DuplexResourceStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/stream/src/DuplexResourceStream.php:193
PHP   9. React\Stream\Util::React\Stream\{closure:phar:///Users/florianlevis/phiremock.phar/vendor/react/stream/src/Util.php:70-72}() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  10. React\Socket\Connection->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/stream/src/Util.php:71
PHP  11. React\Http\Io\RequestHeaderParser->feed() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  12. React\Http\Io\RequestHeaderParser->parseAndEmitRequest() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/RequestHeaderParser.php:47
PHP  13. React\Http\Io\RequestHeaderParser->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/RequestHeaderParser.php:59
PHP  14. React\Http\StreamingServer->React\Http\{closure:phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/StreamingServer.php:172-181}() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  15. React\Socket\Connection->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/StreamingServer.php:179
PHP  16. React\Http\Io\CloseProtectionStream->handleData() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  17. React\Http\Io\CloseProtectionStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/CloseProtectionStream.php:96
PHP  18. React\Http\Io\LengthLimitedStream->handleData() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  19. React\Http\Io\LengthLimitedStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/LengthLimitedStream.php:87
PHP  20. React\Http\Io\HttpBodyStream->handleEnd() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  21. React\Http\Io\HttpBodyStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/HttpBodyStream.php:178
PHP  22. Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer->Mcustiel\Phiremock\Server\Http\Implementation\{closure:phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:146-149}() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
PHP  23. Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer->onRequest() phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:147
PHP  24. Mcustiel\Phiremock\Server\Phiremock->execute() phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:127
PHP  25. Mcustiel\PowerRoute\PowerRoute->start() phar:///Users/florianlevis/phiremock.phar/src/Server/Phiremock.php:57
PHP  26. Mcustiel\PowerRoute\PowerRoute->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/PowerRoute.php:64
PHP  27. Mcustiel\PowerRoute\Actions\GoToAction->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/PowerRoute.php:90
PHP  28. Mcustiel\PowerRoute\PowerRoute->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/Actions/GoToAction.php:14
PHP  29. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/PowerRoute.php:90
PHP  30. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->processAndGetResponse() phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/AddExpectationAction.php:68
PHP  31. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->createObjectFromRequestAndProcess() phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/Base/AbstractRequestAction.php:106
PHP  32. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->parseRequestObject() phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/Base/AbstractRequestAction.php:147

Fatal error: Method Mcustiel\Phiremock\Domain\Expectation::__toString() must not throw an exception, caught Error: Call to a member function __toString() on array in phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/Base/AbstractRequestAction.php on line 0

Call Stack:
    0.0084     815592   1. {main}() /Users/florianlevis/phiremock.phar:0
    0.0101     808064   2. require('phar:///Users/florianlevis/phiremock.phar/bin/phiremock') /Users/florianlevis/phiremock.phar:10
    0.0104     826880   3. require('phar:///Users/florianlevis/phiremock.phar/bin/phiremock.php') phar:///Users/florianlevis/phiremock.phar/bin/phiremock:3
    0.0305    3072528   4. Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer->listen() phar:///Users/florianlevis/phiremock.phar/bin/phiremock.php:81
    0.0329    3200936   5. React\EventLoop\StreamSelectLoop->run() phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:102
    8.6351    3426648   6. React\EventLoop\StreamSelectLoop->waitForStreamActivity() phar:///Users/florianlevis/phiremock.phar/vendor/react/event-loop/src/StreamSelectLoop.php:211
    8.6351    3427128   7. React\Stream\DuplexResourceStream->handleData() phar:///Users/florianlevis/phiremock.phar/vendor/react/event-loop/src/StreamSelectLoop.php:244
    8.6352    3428296   8. React\Stream\DuplexResourceStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/stream/src/DuplexResourceStream.php:193
    8.6352    3428296   9. React\Stream\Util::React\Stream\{closure:phar:///Users/florianlevis/phiremock.phar/vendor/react/stream/src/Util.php:70-72}() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6352    3428672  10. React\Socket\Connection->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/stream/src/Util.php:71
    8.6352    3428672  11. React\Http\Io\RequestHeaderParser->feed() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6352    3428672  12. React\Http\Io\RequestHeaderParser->parseAndEmitRequest() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/RequestHeaderParser.php:47
    8.6375    3605472  13. React\Http\Io\RequestHeaderParser->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/RequestHeaderParser.php:59
    8.6375    3605472  14. React\Http\StreamingServer->React\Http\{closure:phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/StreamingServer.php:172-181}() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6388    3777392  15. React\Socket\Connection->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/StreamingServer.php:179
    8.6388    3777392  16. React\Http\Io\CloseProtectionStream->handleData() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6388    3777768  17. React\Http\Io\CloseProtectionStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/CloseProtectionStream.php:96
    8.6388    3777768  18. React\Http\Io\LengthLimitedStream->handleData() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6388    3777768  19. React\Http\Io\LengthLimitedStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/LengthLimitedStream.php:87
    8.6388    3777768  20. React\Http\Io\HttpBodyStream->handleEnd() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6388    3777768  21. React\Http\Io\HttpBodyStream->emit() phar:///Users/florianlevis/phiremock.phar/vendor/react/http/src/Io/HttpBodyStream.php:178
    8.6388    3777768  22. Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer->Mcustiel\Phiremock\Server\Http\Implementation\{closure:phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:146-149}() phar:///Users/florianlevis/phiremock.phar/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    8.6392    3815256  23. Mcustiel\Phiremock\Server\Http\Implementation\ReactPhpServer->onRequest() phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:147
    8.6400    3865088  24. Mcustiel\Phiremock\Server\Phiremock->execute() phar:///Users/florianlevis/phiremock.phar/src/Server/Http/Implementation/ReactPhpServer.php:127
    8.6400    3865088  25. Mcustiel\PowerRoute\PowerRoute->start() phar:///Users/florianlevis/phiremock.phar/src/Server/Phiremock.php:57
    8.6403    3872952  26. Mcustiel\PowerRoute\PowerRoute->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/PowerRoute.php:64
    8.6417    3915456  27. Mcustiel\PowerRoute\Actions\GoToAction->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/PowerRoute.php:90
    8.6417    3915456  28. Mcustiel\PowerRoute\PowerRoute->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/Actions/GoToAction.php:14
    8.6428    4126456  29. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->execute() phar:///Users/florianlevis/phiremock.phar/vendor/mcustiel/power-route/src/PowerRoute.php:90
    8.6428    4126776  30. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->processAndGetResponse() phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/AddExpectationAction.php:68
    8.6428    4126776  31. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->createObjectFromRequestAndProcess() phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/Base/AbstractRequestAction.php:106
    8.6428    4126776  32. Mcustiel\Phiremock\Server\Actions\AddExpectationAction->parseRequestObject() phar:///Users/florianlevis/phiremock.phar/src/Server/Actions/Base/AbstractRequestAction.php:147

[2019-03-20 22:41:59] stdoutLogger.INFO: Stopping Phiremock... [] []
[2019-03-20 22:41:59] stdoutLogger.INFO: Bye bye [] []

Multiple matches per Is:matching() (Question)

Is there a way to get all (global) matches with one (or multiple) matcher?

Example Request:
[ { "name": "Foo" }, { "name": "Bar" } ]

So I can use this matches (in this example "names") in response by '{body.1}' , '{body.2}' and so on...

In a nutshell: I need a preg_match_all ;-)

Reason for Symfony version lock?

Just wondering if there was a specific reason for the Symfony version lock being <5.0 before embarking on a PR to remedy this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.