PHP version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project
We are using pact-foundation/pact-php 8.1 and below is our PHP (we are running on PHP 8.1) code what we are using. In docker logs we can see exactly 64 calls to broker.
$config = new VerifierConfig();
$config->setProviderName('Our Service')
->setProviderVersion($this->pactVersion)
->addConsumerVersionTag($this->pactConsumerTag)
->setProviderVersionTag($this->pactProviderTag)
->setBrokerUri(new Uri($this->pactBrokerUri))
->setProviderBaseUrl(new Uri($this->pactProviderBaseUrl))
->addCustomProviderHeader(
'Authorization',
'Bearer ' . $this->token
)
->setPublishResults($this->pactPublish);
$verifier = new Verifier($config);
try {
$verifier->verifyFromConfig();
} catch (\Throwable $e) {
$this->tester->fail('Contracts could not be verified: ' . $e->getMessage());
}
We have problem that if you add more than 64 tests in a provider then the tests will never end. We waited 2h but looks like it's get stucked somewhere in
amphp/amp
exactly here https://github.com/amphp/amp/blob/master/lib/Loop/NativeDriver.php#L300We are using pact-foundation/pact-php 8.1 and below is our PHP (we are running on PHP 8.1) code what we are using. In docker logs we can see exactly 64 calls to broker.