/** * @param \WireMock\Client\RequestPatternBuilder|integer $builderOrCount * @param \WireMock\Client\RequestPatternBuilder $builder */ public function receivedRequestToWireMock($builderOrCount, RequestPatternBuilder $builder = null) { $this->wireMock->verify($builderOrCount, $builder); }
public function tryToTest(\AcceptanceTester $I) { $I->expectRequestToWireMock(WireMock::get(WireMock::urlEqualTo('/some/url'))->willReturn(WireMock::aResponse()->withHeader('Content-Type', 'text/plain')->withBody('Hello world!'))); $response = file_get_contents('http://localhost:18080/some/url'); $I->receivedRequestToWireMock(WireMock::getRequestedFor(WireMock::urlEqualTo('/some/url'))); }
/** * Class destructor. */ public function __destruct() { $connection = WireMockClient::create('localhost', $this->config['port']); if ($connection->isAlive()) { $connection->shutdownServer(); } $this->process->stop(); }