Skip to content

Commit 298e455

Browse files
authored
Merge pull request #163 from SimonFrings/tests
Run tests on PHPUnit 9 and clean up test suite
2 parents 9943b55 + 67d6e7b commit 298e455

13 files changed

+73
-143
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"require-dev": {
1414
"clue/block-react": "^1.2",
15-
"phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35"
15+
"phpunit/phpunit": "^9.0 || ^4.8.35"
1616
},
1717
"autoload": {
1818
"psr-4": { "React\\Dns\\": "src" }

phpunit.xml.dist

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
bootstrap="vendor/autoload.php"
12-
>
3+
<phpunit bootstrap="vendor/autoload.php" colors="true">
134
<testsuites>
145
<testsuite name="React Test Suite">
156
<directory>./tests/</directory>

tests/Config/ConfigTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@ public function testLoadsFromExplicitPath()
3232
$this->assertEquals(array('8.8.8.8'), $config->nameservers);
3333
}
3434

35-
/**
36-
* @expectedException RuntimeException
37-
*/
3835
public function testLoadThrowsWhenPathIsInvalid()
3936
{
37+
$this->setExpectedException('RuntimeException');
4038
Config::loadResolvConfBlocking(__DIR__ . '/invalid.conf');
4139
}
4240

tests/Config/HostsFileTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ public function testDefaultShouldHaveLocalhostMapped()
2525
$this->assertContains('127.0.0.1', $hosts->getIpsForHost('localhost'));
2626
}
2727

28-
/**
29-
* @expectedException RuntimeException
30-
*/
3128
public function testLoadThrowsForInvalidPath()
3229
{
30+
$this->setExpectedException('RuntimeException');
3331
HostsFile::loadFromPathBlocking('does/not/exist');
3432
}
3533

tests/FunctionalResolverTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
class FunctionalTest extends TestCase
1111
{
12-
public function setUp()
12+
/**
13+
* @before
14+
*/
15+
public function setUpResolver()
1316
{
1417
$this->loop = LoopFactory::create();
1518

0 commit comments

Comments
 (0)