diff --git a/composer.json b/composer.json index d110e2a..6f83a32 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "evenement/evenement": "^3.0 || ^2.0 || ^1.0" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8.10", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35", "clue/stream-filter": "~1.2" }, "suggest": { diff --git a/tests/DuplexResourceStreamTest.php b/tests/DuplexResourceStreamTest.php index 4bc9326..0aba089 100644 --- a/tests/DuplexResourceStreamTest.php +++ b/tests/DuplexResourceStreamTest.php @@ -36,17 +36,18 @@ public function testConstructorWithExcessiveMode() /** * @covers React\Stream\DuplexResourceStream::__construct + * @expectedException InvalidArgumentException */ public function testConstructorThrowsExceptionOnInvalidStream() { $loop = $this->createLoopMock(); - $this->setExpectedException('InvalidArgumentException'); new DuplexResourceStream('breakme', $loop); } /** * @covers React\Stream\DuplexResourceStream::__construct + * @expectedException InvalidArgumentException */ public function testConstructorThrowsExceptionOnWriteOnlyStream() { @@ -56,7 +57,6 @@ public function testConstructorThrowsExceptionOnWriteOnlyStream() $loop = $this->createLoopMock(); - $this->setExpectedException('InvalidArgumentException'); new DuplexResourceStream(STDOUT, $loop); } @@ -77,6 +77,7 @@ public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode /** * @covers React\Stream\DuplexResourceStream::__construct + * @expectedException RunTimeException */ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() { @@ -87,7 +88,6 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking( $stream = fopen('blocking://test', 'r+'); $loop = $this->createLoopMock(); - $this->setExpectedException('RuntimeException'); new DuplexResourceStream($stream, $loop); } diff --git a/tests/ReadableResourceStreamTest.php b/tests/ReadableResourceStreamTest.php index 64aa101..8a960e1 100644 --- a/tests/ReadableResourceStreamTest.php +++ b/tests/ReadableResourceStreamTest.php @@ -35,17 +35,18 @@ public function testConstructorWithExcessiveMode() /** * @covers React\Stream\ReadableResourceStream::__construct + * @expectedException InvalidArgumentException */ public function testConstructorThrowsExceptionOnInvalidStream() { $loop = $this->createLoopMock(); - $this->setExpectedException('InvalidArgumentException'); new ReadableResourceStream(false, $loop); } /** * @covers React\Stream\ReadableResourceStream::__construct + * @expectedException InvalidArgumentException */ public function testConstructorThrowsExceptionOnWriteOnlyStream() { @@ -55,7 +56,6 @@ public function testConstructorThrowsExceptionOnWriteOnlyStream() $loop = $this->createLoopMock(); - $this->setExpectedException('InvalidArgumentException'); new ReadableResourceStream(STDOUT, $loop); } @@ -76,6 +76,7 @@ public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode /** * @covers React\Stream\ReadableResourceStream::__construct + * @expectedException RuntimeException */ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() { @@ -86,7 +87,6 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking( $stream = fopen('blocking://test', 'r+'); $loop = $this->createLoopMock(); - $this->setExpectedException('RuntimeException'); new ReadableResourceStream($stream, $loop); } diff --git a/tests/TestCase.php b/tests/TestCase.php index 63746f9..c8fc1db 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,7 +2,9 @@ namespace React\Tests\Stream; -class TestCase extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase as BaseTestCase; + +class TestCase extends BaseTestCase { protected function expectCallableExactly($amount) { diff --git a/tests/WritableStreamResourceTest.php b/tests/WritableStreamResourceTest.php index 23da14b..fdf69c3 100644 --- a/tests/WritableStreamResourceTest.php +++ b/tests/WritableStreamResourceTest.php @@ -75,6 +75,7 @@ public function testConstructorThrowsExceptionOnReadOnlyStreamWithExcessiveMode( /** * @covers React\Stream\WritableResourceStream::__construct + * @expectedException RuntimeException */ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() { @@ -85,7 +86,6 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking( $stream = fopen('blocking://test', 'r+'); $loop = $this->createLoopMock(); - $this->setExpectedException('RuntimeException'); new WritableResourceStream($stream, $loop); }