Skip to content

Commit f92abcd

Browse files
authored
Merge pull request #372 from clue-labs/tests-online
Support skipping all online tests with `--exclude-group internet`
2 parents bca744c + b7a9251 commit f92abcd

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,14 @@ To run the test suite, go to the project root and run:
27582758
$ php vendor/bin/phpunit
27592759
```
27602760

2761+
The test suite also contains a number of functional integration tests that rely
2762+
on a stable internet connection.
2763+
If you do not want to run these, they can simply be skipped like this:
2764+
2765+
```bash
2766+
$ php vendor/bin/phpunit --exclude-group internet
2767+
```
2768+
27612769
## License
27622770

27632771
MIT, see [LICENSE file](LICENSE).

tests/Client/FunctionalIntegrationTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public function testSuccessfulResponseEmitsEnd()
101101
/** @group internet */
102102
public function testPostDataReturnsData()
103103
{
104+
if (defined('HHVM_VERSION')) {
105+
$this->markTestSkipped('Not supported on HHVM');
106+
}
107+
104108
$loop = Factory::create();
105109
$client = new Client($loop);
106110

@@ -130,6 +134,10 @@ public function testPostDataReturnsData()
130134
/** @group internet */
131135
public function testPostJsonReturnsData()
132136
{
137+
if (defined('HHVM_VERSION')) {
138+
$this->markTestSkipped('Not supported on HHVM');
139+
}
140+
133141
$loop = Factory::create();
134142
$client = new Client($loop);
135143

tests/FunctionalBrowserTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,25 +351,25 @@ public function testGetRequestWithResponseBufferExceededDuringStreamingRejects()
351351
}
352352

353353
/**
354-
* @group online
354+
* @group internet
355355
* @doesNotPerformAssertions
356356
*/
357357
public function testCanAccessHttps()
358358
{
359-
if (!function_exists('stream_socket_enable_crypto')) {
360-
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
359+
if (defined('HHVM_VERSION')) {
360+
$this->markTestSkipped('Not supported on HHVM');
361361
}
362362

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

366366
/**
367-
* @group online
367+
* @group internet
368368
*/
369369
public function testVerifyPeerEnabledForBadSslRejects()
370370
{
371-
if (!function_exists('stream_socket_enable_crypto')) {
372-
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
371+
if (defined('HHVM_VERSION')) {
372+
$this->markTestSkipped('Not supported on HHVM');
373373
}
374374

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

387387
/**
388-
* @group online
388+
* @group internet
389389
* @doesNotPerformAssertions
390390
*/
391391
public function testVerifyPeerDisabledForBadSslResolves()
392392
{
393-
if (!function_exists('stream_socket_enable_crypto')) {
394-
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
393+
if (defined('HHVM_VERSION')) {
394+
$this->markTestSkipped('Not supported on HHVM');
395395
}
396396

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

408408
/**
409-
* @group online
409+
* @group internet
410410
*/
411411
public function testInvalidPort()
412412
{

tests/Io/RequestHeaderParserTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ public function testInvalidMalformedRequestLineParseException()
340340
$this->assertSame('Unable to parse invalid request-line', $error->getMessage());
341341
}
342342

343-
/**
344-
* @group a
345-
*/
346343
public function testInvalidMalformedRequestHeadersThrowsParseException()
347344
{
348345
$error = null;
@@ -362,9 +359,6 @@ public function testInvalidMalformedRequestHeadersThrowsParseException()
362359
$this->assertSame('Unable to parse invalid request header fields', $error->getMessage());
363360
}
364361

365-
/**
366-
* @group a
367-
*/
368362
public function testInvalidMalformedRequestHeadersWhitespaceThrowsParseException()
369363
{
370364
$error = null;

0 commit comments

Comments
 (0)