public function fullUrlShouldBeEvaluated(AcceptanceTester $I) { $expectation = PhiremockClient::on(A::postRequest()->andUrl(Is::equalTo('/potato/coconut/?tomato=123'))->andBody(Is::containing('This is the body')))->then(Respond::withStatusCode(202)->andBody('Tomato!')->andDelayInMillis(2500)->andHeader('X-Tomato', 'Potato-received')); $this->phiremock->createExpectation($expectation); $I->sendPOST('/potato/coconut/?tomato=123', '{"key": "This is the body"}'); $I->seeResponseCodeIs(202); $I->seeResponseEquals('Tomato!'); $I->seeHttpHeader('X-Tomato', 'Potato-received'); }
public function expectARequestToRemoteServiceWithAResponse(Expectation $expectation) { $this->phiremock->createExpectation($expectation); }