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

Support skipping all online tests with --exclude-group internet #372

Merged
merged 1 commit into from
Jul 11, 2020
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,14 @@ To run the test suite, go to the project root and run:
$ php vendor/bin/phpunit
```

The test suite also contains a number of functional integration tests that rely
on a stable internet connection.
If you do not want to run these, they can simply be skipped like this:

```bash
$ php vendor/bin/phpunit --exclude-group internet
```

## License

MIT, see [LICENSE file](LICENSE).
8 changes: 8 additions & 0 deletions tests/Client/FunctionalIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public function testSuccessfulResponseEmitsEnd()
/** @group internet */
public function testPostDataReturnsData()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on HHVM');
}

$loop = Factory::create();
$client = new Client($loop);

Expand Down Expand Up @@ -130,6 +134,10 @@ public function testPostDataReturnsData()
/** @group internet */
public function testPostJsonReturnsData()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on HHVM');
}

$loop = Factory::create();
$client = new Client($loop);

Expand Down
20 changes: 10 additions & 10 deletions tests/FunctionalBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,25 +351,25 @@ public function testGetRequestWithResponseBufferExceededDuringStreamingRejects()
}

/**
* @group online
* @group internet
* @doesNotPerformAssertions
*/
public function testCanAccessHttps()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on HHVM');
}

Block\await($this->browser->get('https://www.google.com/'), $this->loop);
}

/**
* @group online
* @group internet
*/
public function testVerifyPeerEnabledForBadSslRejects()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on HHVM');
}

$connector = new Connector($this->loop, array(
Expand All @@ -385,13 +385,13 @@ public function testVerifyPeerEnabledForBadSslRejects()
}

/**
* @group online
* @group internet
* @doesNotPerformAssertions
*/
public function testVerifyPeerDisabledForBadSslResolves()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on HHVM');
}

$connector = new Connector($this->loop, array(
Expand All @@ -406,7 +406,7 @@ public function testVerifyPeerDisabledForBadSslResolves()
}

/**
* @group online
* @group internet
*/
public function testInvalidPort()
{
Expand Down
6 changes: 0 additions & 6 deletions tests/Io/RequestHeaderParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,6 @@ public function testInvalidMalformedRequestLineParseException()
$this->assertSame('Unable to parse invalid request-line', $error->getMessage());
}

/**
* @group a
*/
public function testInvalidMalformedRequestHeadersThrowsParseException()
{
$error = null;
Expand All @@ -362,9 +359,6 @@ public function testInvalidMalformedRequestHeadersThrowsParseException()
$this->assertSame('Unable to parse invalid request header fields', $error->getMessage());
}

/**
* @group a
*/
public function testInvalidMalformedRequestHeadersWhitespaceThrowsParseException()
{
$error = null;
Expand Down