Skip to content

Commit c7bf748

Browse files
committed
Add test group to skip integration tests relying on internet connection
1 parent 8c63b16 commit c7bf748

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

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

181+
The test suite also contains a number of functional integration tests that rely
182+
on a stable internet connection.
183+
If you do not want to run these, they can simply be skipped like this:
184+
185+
```bash
186+
$ php vendor/bin/phpunit --exclude-group internet
187+
```
188+
181189
## License
182190

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

tests/FunctionalResolverTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function testResolveLocalhostResolves()
2525
$this->loop->run();
2626
}
2727

28+
/**
29+
* @group internet
30+
*/
2831
public function testResolveGoogleResolves()
2932
{
3033
$promise = $this->resolver->resolve('google.com');
@@ -33,6 +36,9 @@ public function testResolveGoogleResolves()
3336
$this->loop->run();
3437
}
3538

39+
/**
40+
* @group internet
41+
*/
3642
public function testResolveInvalidRejects()
3743
{
3844
$promise = $this->resolver->resolve('example.invalid');

tests/Query/ExecutorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function resolveShouldNotStartOrCancelTimerWhenCancelledWithTimeoutIsNull
9494
$this->executor = new Executor($this->loop, $this->parser, $this->dumper, null);
9595

9696
$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
97-
$promise = $this->executor->query('8.8.8.8:53', $query);
97+
$promise = $this->executor->query('127.0.0.1:53', $query);
9898

9999
$promise->cancel();
100100

0 commit comments

Comments
 (0)