8000 Merge pull request #10 from clue-labs/deps · SimonFrings/reactphp-shell@e811d77 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e811d77

Browse files
authored
Merge pull request clue#10 from clue-labs/deps
Forward compatibility with stable ReactPHP components
2 parents c6c7a09 + 3a80ed7 commit e811d77

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
},
1616
"require": {
1717
"php": ">=5.3",
18-
"react/promise": "~1.0|~2.0",
19-
"react/child-process": "~0.3.0|~0.4.0",
20-
"react/stream": "~0.3.0|~0.4.0",
21-
"react/event-loop": "~0.3.0|~0.4.0"
18+
"react/child-process": "^0.5 || ^0.4 || ^0.3",
19+
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
20+
"react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6",
21+
"react/promise": "^2.0 || ^1.0"
2222
},
2323
"require-dev": {
2424
"phpunit/phpunit": "^7.0 || ^6.0 || ^5.0 || ^4.8.35"

src/DeferredShell.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Clue\React\Shell;
44

55
use React\Promise\Deferred;
6-
use React\Stream\CompositeStream;
6+
use React\Stream\DuplexStreamInterface;
77
use RuntimeException;
88

99
class DeferredShell
@@ -21,7 +21,7 @@ class DeferredShell
2121
private $buffer = '';
2222
private $started = false;
2323

24-
public function __construct(CompositeStream $stream)
24+
public function __construct(DuplexStreamInterface $stream)
2525
{
2626
$this->stream = $stream;
2727

tests/DeferredShellTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DeferredShellTest extends TestCase
88

99
public function setUp()
1010
{
11-
$this->stream = $this->getMockBuilder('React\Stream\CompositeStream')->disableOriginalConstructor()->getMock();
11+
$this->stream = $this->getMockBuilder('React\Stream\DuplexStreamInterface')->getMock();
1212
}
1313

1414
public function testExecuteWritesToStream()

tests/ProcessLauncherTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use Clue\React\Shell\ProcessLauncher;
4-
use React\Stream\ReadableStream;
54

65
class ProcessLauncherTest extends TestCase
76
{
@@ -30,9 +29,12 @@ public function testProcessWillBeStarted()
3029
public function testClosingStreamTerminatesRunningProcess()
3130
{
3231
$process = $this->getMockBuilder('React\ChildProcess\Process')->disableOriginalConstructor()->getMock();
33-
$process->stdout = new ReadableStream();
32+
$process->stdout = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
3433
$process->stdin = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
3534

35+
$process->stdout->expects($this->any())->method('isReadable')->willReturn(true);
36+
$process->stdin->expects($this->any())->method('isWritable')->willReturn(true);
37+
3638
$process->expects($this->once())->method('isRunning')->will($this->returnValue(true));
3739
$process->expects($this->once())->method('terminate')->with($this->equalTo(SIGKILL));
3840

@@ -44,9 +46,12 @@ public function testClosingStreamTerminatesRunningProcess()
4446
public function testClosingStreamOfNonRunningProcessWillNotTerminate()
4547
{
4648
$process = $this->getMockBuilder('React\ChildProcess\Process')->disableOriginalConstructor()->getMock();
47-
$process->stdout = new ReadableStream();
49+
$process->stdout = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
4850
$process->stdin = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();
4951

52+
$process->stdout->expects($this->any())->method('isReadable')->willReturn(true);
53+
$process->stdin->expects($this->any())->method('isWritable')->willReturn(true);
54+
5055
$process->expects($this->once())->method('isRunning')->will($this->returnValue(false));
5156
$process->expects($this->never())->method('terminate');
5257

0 commit comments

Comments
 (0)
0