Skip to content

Commit

Permalink
chore: Reuse code in xml example
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Oct 27, 2023
1 parent 64a2b2a commit b566bfc
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions example/xml/provider/tests/PactVerifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,20 @@
use GuzzleHttp\Psr7\Uri;
use PhpPact\Standalone\ProviderVerifier\Model\VerifierConfig;
use PhpPact\Standalone\ProviderVerifier\Verifier;
use PhpPactTest\Helper\ProviderProcess;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Process;

class PactVerifyTest extends TestCase
{
private Process $process;
private ProviderProcess $process;

/**
* Run the PHP build-in web server.
*/
protected function setUp(): void
{
$this->process = new Process(['php', '-S', '127.0.0.1:7202', '-t', __DIR__ . '/../public/']);

$this->process = new ProviderProcess(__DIR__ . '/../public/');
$this->process->start();
$this->process->waitUntil(function (): bool {
$fp = @fsockopen('127.0.0.1', 7202);
$isOpen = is_resource($fp);
if ($isOpen) {
fclose($fp);
}

return $isOpen;
});
}

/**
Expand Down

0 comments on commit b566bfc

Please sign in to comment.