Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ConConovaloff committed Jun 20, 2016
1 parent b8fb317 commit 9bc3398
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions StreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public function readLine()
}

$lineList = preg_split("/(\\r\\n|\\r|\\n)/", $this->data, -1, PREG_SPLIT_DELIM_CAPTURE);
if (!isset($lineList[0])) {
return false;
}

$result = $lineList[0];

if (isset($lineList[1])) {
Expand Down
10 changes: 10 additions & 0 deletions tests/StreamContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,14 @@ public function testChangeField()
$this->setExpectedException('axy\errors\FieldNotExist');
$this->assertInstanceOf('axy\env\StreamTest', $streamContainer->notExist);
}

public function testBadStream()
{
$stream = new \stdClass();

$this->setExpectedException('axy\errors\NotValid');
new StreamContainer([
'stdin' => $stream,
]);
}
}

0 comments on commit 9bc3398

Please sign in to comment.