Skip to content
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
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
},
"require": {
"php": ">=5.3",
"react/promise": "~1.0|~2.0",
"react/child-process": "~0.3.0|~0.4.0",
"react/stream": "~0.3.0|~0.4.0",
"react/event-loop": "~0.3.0|~0.4.0"
"react/child-process": "^0.5 || ^0.4 || ^0.3",
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
"react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.6",
"react/promise": "^2.0 || ^1.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0 || ^6.0 || ^5.0 || ^4.8.35"
Expand Down
4 changes: 2 additions & 2 deletions src/DeferredShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Clue\React\Shell;

use React\Promise\Deferred;
use React\Stream\CompositeStream;
use React\Stream\DuplexStreamInterface;
use RuntimeException;

class DeferredShell
Expand All @@ -21,7 +21,7 @@ class DeferredShell
private $buffer = '';
private $started = false;

public function __construct(CompositeStream $stream)
public function __construct(DuplexStreamInterface $stream)
{
$this->stream = $stream;

Expand Down
2 changes: 1 addition & 1 deletion tests/DeferredShellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DeferredShellTest extends TestCase

public function setUp()
{
$this->stream = $this->getMockBuilder('React\Stream\CompositeStream')->disableOriginalConstructor()->getMock();
$this->stream = $this->getMockBuilder('React\Stream\DuplexStreamInterface')->getMock();
}

public function testExecuteWritesToStream()
Expand Down
11 changes: 8 additions & 3 deletions tests/ProcessLauncherTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

use Clue\React\Shell\ProcessLauncher;
use React\Stream\ReadableStream;

class ProcessLauncherTest extends TestCase
{
Expand Down Expand Up @@ -30,9 +29,12 @@ public function testProcessWillBeStarted()
public function testClosingStreamTerminatesRunningProcess()
{
$process = $this->getMockBuilder('React\ChildProcess\Process')->disableOriginalConstructor()->getMock();
$process->stdout = new ReadableStream();
$process->stdout = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock();
$process->stdin = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock();

$process->stdout->expects($this->any())->method('isReadable')->willReturn(true);
$process->stdin->expects($this->any())->method('isWritable')->willReturn(true);

$process->expects($this->once())->method('isRunning')->will($this->returnValue(true));
$process->expects($this->once())->method('terminate')->with($this->equalTo(SIGKILL));

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

$process->stdout->expects($this->any())->method('isReadable')->willReturn(true);
$process->stdin->expects($this->any())->method('isWritable')->willReturn(true);

$process->expects($this->once())->method('isRunning')->will($this->returnValue(false));
$process->expects($this->never())->method('terminate');

Expand Down