1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-03 10:53:01 +02:00

added resource stream detection and initialization, with tests

This commit is contained in:
Ramiro Araujo
2015-04-10 15:08:13 -03:00
parent 7edc830d19
commit e5259db76b
2 changed files with 42 additions and 0 deletions

View File

@@ -58,6 +58,15 @@ class AbstractDecoderTest extends PHPUnit_Framework_TestCase
$this->assertFalse($source->isUrl());
}
public function testIsStream()
{
$source = $this->getTestDecoder(fopen(__DIR__ . '/images/test.jpg', 'r'));
$this->assertTrue($source->isStream());
$source = $this->getTestDecoder(null);
$this->assertFalse($source->isStream());
}
public function testIsBinary()
{
$source = $this->getTestDecoder(file_get_contents(__DIR__.'/images/test.jpg'));