Skip to content

Commit

Permalink
Merge pull request #122 from gabriel-caruso/phpunit
Browse files Browse the repository at this point in the history
Forward compatibility with PHPUnit 6
  • Loading branch information
jsor authored Nov 18, 2017
2 parents bbf5938 + 7a0706b commit 97269c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions tests/DuplexResourceStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -56,7 +57,6 @@ public function testConstructorThrowsExceptionOnWriteOnlyStream()

$loop = $this->createLoopMock();

$this->setExpectedException('InvalidArgumentException');
new DuplexResourceStream(STDOUT, $loop);
}

Expand All @@ -77,6 +77,7 @@ public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode

/**
* @covers React\Stream\DuplexResourceStream::__construct
* @expectedException RunTimeException
*/
public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking()
{
Expand All @@ -87,7 +88,6 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking(
$stream = fopen('blocking://test', 'r+');
$loop = $this->createLoopMock();

$this->setExpectedException('RuntimeException');
new DuplexResourceStream($stream, $loop);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/ReadableResourceStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -55,7 +56,6 @@ public function testConstructorThrowsExceptionOnWriteOnlyStream()

$loop = $this->createLoopMock();

$this->setExpectedException('InvalidArgumentException');
new ReadableResourceStream(STDOUT, $loop);
}

Expand All @@ -76,6 +76,7 @@ public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode

/**
* @covers React\Stream\ReadableResourceStream::__construct
* @expectedException RuntimeException
*/
public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking()
{
Expand All @@ -86,7 +87,6 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking(
$stream = fopen('blocking://test', 'r+');
$loop = $this->createLoopMock();

$this->setExpectedException('RuntimeException');
new ReadableResourceStream($stream, $loop);
}

Expand Down
4 changes: 3 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/WritableStreamResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function testConstructorThrowsExceptionOnReadOnlyStreamWithExcessiveMode(

/**
* @covers React\Stream\WritableResourceStream::__construct
* @expectedException RuntimeException
*/
public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking()
{
Expand All @@ -85,7 +86,6 @@ public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking(
$stream = fopen('blocking://test', 'r+');
$loop = $this->createLoopMock();

$this->setExpectedException('RuntimeException');
new WritableResourceStream($stream, $loop);
}

Expand Down

0 comments on commit 97269c1

Please sign in to comment.