<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
darkmatus / phiremock-codeception-module example snippets
$I->takeConnection('secure-host')->reset();
$I->takeConnection('default')->reset();
namespace My\Namespace;
use Mcustiel\Phiremock\Client\Factory;
use GuzzleHttp;
use Psr\Http\Client\ClientInterface;
class FactoryWithGuzzle7 extends Factory
{
public function createRemoteConnection(): ClientInterface
{
return new GuzzleHttp\Client(['allow_redirects' => false]);
}
}
$I->expectARequestToRemoteServiceWithAResponse(
on(getRequest()->andUrl(isEqualTo('/some/url')))
->then(respond(203)->andBody('I am a response'))
);