Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward compatibility with PHPUnit 6 #122

Merged
merged 2 commits into from
Nov 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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