Skip to content

Commit

Permalink
Test writing to invalid stream name
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jan 15, 2019
1 parent 5fe33e4 commit 867f5cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/StreamTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Gt\Cli\Test;

use Gt\Cli\InvalidStreamNameException;
use Gt\Cli\Stream;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -86,4 +87,14 @@ public function testWriteToIn() {
$in->rewind();
self::assertEmpty($in->fread(1024));
}

public function testInvalidStreamName() {
$stream = new Stream(
"php://memory",
"php://memory",
"php://memory"
);
$this->expectException(InvalidStreamNameException::class);
$stream->write("this does not exist", "nothing");
}
}

0 comments on commit 867f5cf

Please sign in to comment.