Skip to content

Commit 8ed21e6

Browse files
committed
Compatibility with PHPUnit v5
1 parent 02f6af8 commit 8ed21e6

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
},
2020
"require-dev": {
2121
"react/event-loop": " ^0.4 || ^0.3",
22-
"phpunit/phpunit": "^4.8"
22+
"phpunit/phpunit": "^5.0 || ^4.8"
2323
}
2424
}

tests/DecoderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function testEmitErrorEventWillForwardAndClose()
180180

181181
public function testPipeReturnsDestStream()
182182
{
183-
$dest = $this->getMock('React\Stream\WritableStreamInterface');
183+
$dest = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
184184

185185
$ret = $this->decoder->pipe($dest);
186186

@@ -189,7 +189,7 @@ public function testPipeReturnsDestStream()
189189

190190
public function testForwardPauseToInput()
191191
{
192-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
192+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
193193
$this->input->expects($this->once())->method('pause');
194194

195195
$this->decoder = new Decoder($this->input);
@@ -198,7 +198,7 @@ public function testForwardPauseToInput()
198198

199199
public function testForwardResumeToInput()
200200
{
201-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
201+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
202202
$this->input->expects($this->once())->method('resume');
203203

204204
$this->decoder = new Decoder($this->input);

tests/EncoderTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testPrettyPrintDoesNotMakeSenseForNDJson()
2828

2929
public function testWriteString()
3030
{
31-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
31+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
3232
$this->output->expects($this->once())->method('isWritable')->willReturn(true);
3333
$this->encoder = new Encoder($this->output);
3434

@@ -39,7 +39,7 @@ public function testWriteString()
3939

4040
public function testWriteNull()
4141
{
42-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
42+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
4343
$this->output->expects($this->once())->method('isWritable')->willReturn(true);
4444
$this->encoder = new Encoder($this->output);
4545

@@ -50,7 +50,7 @@ public function testWriteNull()
5050

5151
public function testWriteInfiniteWillEmitErrorAndClose()
5252
{
53-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
53+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
5454
$this->output->expects($this->once())->method('isWritable')->willReturn(true);
5555
$this->encoder = new Encoder($this->output);
5656

@@ -66,7 +66,7 @@ public function testWriteInfiniteWillEmitErrorAndClose()
6666

6767
public function testEndWithoutDataWillEndOutputWithoutData()
6868
{
69-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
69+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
7070
$this->output->expects($this->once())->method('isWritable')->willReturn(true);
7171
$this->encoder = new Encoder($this->output);
7272

@@ -78,7 +78,7 @@ public function testEndWithoutDataWillEndOutputWithoutData()
7878

7979
public function testEndWithDataWillForwardDataAndEndOutputWithoutData()
8080
{
81-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
81+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
8282
$this->output->expects($this->once())->method('isWritable')->willReturn(true);
8383
$this->encoder = new Encoder($this->output);
8484

@@ -106,7 +106,7 @@ public function testClosingOutputClosesEncoder()
106106

107107
public function testPassingClosedStreamToEncoderWillCloseImmediately()
108108
{
109-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
109+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
110110
$this->output->expects($this->once())->method('isWritable')->willReturn(false);
111111
$this->encoder = new Encoder($this->output);
112112

@@ -115,7 +115,7 @@ public function testPassingClosedStreamToEncoderWillCloseImmediately()
115115

116116
public function testWritingToClosedStreamWillNotForwardData()
117117
{
118-
$this->output = $this->getMock('React\Stream\WritableStreamInterface');
118+
$this->output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
119119
$this->output->expects($this->once())->method('isWritable')->willReturn(false);
120120
$this->encoder = new Encoder($this->output);
121121

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function expectCallableOnceParameter($type)
5353
*/
5454
protected function createCallableMock()
5555
{
56-
return $this->getMock('CallableStub');
56+
return $this->getMockBuilder('CallableStub')->getMock();
5757
}
5858
}
5959

0 commit comments

Comments
 (0)