Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8 from peter279k/test_enhancement
Browse files Browse the repository at this point in the history
Test enhancement
  • Loading branch information
fenric authored Feb 22, 2019
2 parents bcdd227 + 45699b4 commit d6e2dd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/StreamFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function testCreateStreamFromResource()
public function testCreateStreamFromUnopenableFile()
{
$this->expectException(UnopenableStreamException::class);
$this->expectExceptionMessage(\sprintf('Unable to open file "%s/nonexistent.file" in mode "r"', __DIR__));

(new StreamFactory)->createStreamFromFile(__DIR__ . '/nonexistent.file', 'r');
}
Expand Down
10 changes: 5 additions & 5 deletions tests/StreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class StreamTest extends TestCase
{
private $handle;

public function setUp()
protected function setUp()
{
$this->handle = \fopen('php://memory', 'r+b');
}

public function tearDown()
protected function tearDown()
{
if (\is_resource($this->handle))
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public function testDetach()

$this->assertEquals($this->handle, $stream->detach());
$this->assertStreamResourceEquals($stream, null);
$this->assertEquals(null, $stream->detach());
$this->assertNull($stream->detach());
}

public function testClose()
Expand Down Expand Up @@ -305,7 +305,7 @@ public function testGetMetadataUnresourceable()
$stream = new Stream($this->handle);

$stream->close();
$this->assertEquals(null, $stream->getMetadata());
$this->assertNull($stream->getMetadata());
}

public function testGetSize()
Expand All @@ -327,7 +327,7 @@ public function testGetSizeUnresourceable()
$stream = new Stream($this->handle);

$stream->close();
$this->assertEquals(null, $stream->getSize());
$this->assertNull($stream->getSize());
}

public function testToString()
Expand Down

0 comments on commit d6e2dd7

Please sign in to comment.