Skip to content

Commit 84682d3

Browse files
committed
Compatiblility with PHPUnit v5
1 parent e72ad41 commit 84682d3

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"react/stream": "^0.4 || ^0.3"
1919
},
2020
"require-dev": {
21-
"phpunit/phpunit": "^4.8",
21+
"phpunit/phpunit": "^5.0 || ^4.8",
2222
"react/event-loop": "^0.4 || ^0.3"
2323
}
2424
}

tests/ControlCodeParserTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function testClosingInputWillRemoveAllDataListeners()
250250

251251
public function testClosingParserWillCloseInput()
252252
{
253-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
253+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
254254
$this->input->expects($this->once())->method('isReadable')->willReturn(true);
255255
$this->input->expects($this->once())->method('close');
256256

@@ -277,7 +277,7 @@ public function testClosingParserWillRemoveAllDataListeners()
277277

278278
public function testClosingParserMultipleTimesWillOnlyCloseOnce()
279279
{
280-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
280+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
281281
$this->input->expects($this->once())->method('isReadable')->willReturn(true);
282282
$this->input->expects($this->once())->method('close');
283283

@@ -290,7 +290,7 @@ public function testClosingParserMultipleTimesWillOnlyCloseOnce()
290290

291291
public function testPassingClosedInputToParserWillCloseParser()
292292
{
293-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
293+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
294294
$this->input->expects($this->once())->method('isReadable')->willReturn(false);
295295

296296
$this->parser = new ControlCodeParser($this->input);
@@ -311,7 +311,7 @@ public function testPassingClosedInputToParserWillNotAddAnyDataListeners()
311311

312312
public function testWillForwardPauseToInput()
313313
{
314-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
314+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
315315
$this->input->expects($this->once())->method('pause');
316316

317317
$this->parser = new ControlCodeParser($this->input);
@@ -321,7 +321,7 @@ public function testWillForwardPauseToInput()
321321

322322
public function testWillForwardResumeToInput()
323323
{
324-
$this->input = $this->getMock('React\Stream\ReadableStreamInterface');
324+
$this->input = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
325325
$this->input->expects($this->once())->method('resume');
326326

327327
$this->parser = new ControlCodeParser($this->input);
@@ -331,7 +331,7 @@ public function testWillForwardResumeToInput()
331331

332332
public function testPipeWillReturnDestStream()
333333
{
334-
$dest = $this->getMock('React\Stream\WritableStreamInterface');
334+
$dest = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
335335

336336
$ret = $this->parser->pipe($dest);
337337

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)