Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse code #352

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace XmlConsumer\Tests\Service;

use Tienvx\PactPhpXml\Model\Options;
use Tienvx\PactPhpXml\XmlBuilder;
use XmlConsumer\Service\HttpClientService;
use PhpPact\Consumer\InteractionBuilder;
Expand Down
18 changes: 4 additions & 14 deletions example/xml/provider/tests/PactVerifyTest.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
<?php

namespace JsonProvider\Tests;
namespace XmlConsumer\Tests;

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
6 changes: 6 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<testsuite name="PhpPact Multipart Provider Example Tests">
<directory>./example/multipart/provider/tests</directory>
</testsuite>
<testsuite name="PhpPact Xml Consumer Example Tests">
<directory>./example/xml/consumer/tests</directory>
</testsuite>
<testsuite name="PhpPact Xml Provider Example Tests">
<directory>./example/xml/provider/tests</directory>
</testsuite>
<testsuite name="PhpPact Message Consumer Example Tests">
<directory>./example/message/consumer/tests</directory>
</testsuite>
Expand Down