Skip to content

Commit

Permalink
Merge pull request #222 from sideshowcoder/skip-sslip-test-if-sslip-d…
Browse files Browse the repository at this point in the history
…ns-not-configured

Skip sslip.io tests if DNS is not configured
  • Loading branch information
gordalina authored Jan 3, 2023
2 parents eedac2f + b6715ad commit b54f452
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/Adapter/Http/FileGetContentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ public function testFetch()

public function testFetchUnderscores()
{
$client = new SymfonyHttpClient('http://_.127.0.0.1.sslip.io:9999');
$sslipHostname = '_.127.0.0.1.sslip.io';
if (!gethostbynamel($sslipHostname)) {
$this->markTestSkipped(
"{$sslipHostname} does not resolve, sslip DNS is not configured correctly, skipping."
);
}
$client = new SymfonyHttpClient("http://{$sslipHostname}:9999");
$this->assertStringStartsWith('# CacheTool', $client->fetch('README.md'));
}

Expand Down
8 changes: 7 additions & 1 deletion tests/Adapter/Http/SymfonyHttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ public function testFetch()

public function testFetchUnderscores()
{
$client = new SymfonyHttpClient('http://_.127.0.0.1.sslip.io:9999');
$sslipHostname = '_.127.0.0.1.sslip.io';
if (!gethostbynamel($sslipHostname)) {
$this->markTestSkipped(
"{$sslipHostname} does not resolve, sslip DNS is not configured correctly, skipping."
);
}
$client = new SymfonyHttpClient("http://{$sslipHostname}:9999");
$this->assertStringStartsWith('# CacheTool', $client->fetch('README.md'));
}

Expand Down

0 comments on commit b54f452

Please sign in to comment.