Skip to content

Commit

Permalink
Merge pull request #352 from tienvx/reuse-code
Browse files Browse the repository at this point in the history
Reuse code
  • Loading branch information
YOU54F authored Oct 27, 2023
2 parents a073ba4 + b566bfc commit f50a87d
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 f50a87d

Please sign in to comment.