mirror of
https://github.com/Intervention/image.git
synced 2025-08-27 23:59:50 +02:00
Switch EncodedImage::class to temporary stream resource
This commit is contained in:
@@ -13,10 +13,25 @@ final class FileTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
{
|
||||
$file = new File();
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
|
||||
$file = new File('foo');
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
}
|
||||
|
||||
public function testConstructorFromString(): void
|
||||
{
|
||||
$file = new File('foo');
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
}
|
||||
|
||||
public function testConstructorFromResource(): void
|
||||
{
|
||||
$file = new File(fopen('php://temp', 'r'));
|
||||
$this->assertInstanceOf(File::class, $file);
|
||||
}
|
||||
|
||||
public function testSave(): void
|
||||
{
|
||||
$filename = __DIR__ . '/file_' . strval(hrtime(true)) . '.test';
|
||||
@@ -43,6 +58,9 @@ final class FileTest extends BaseTestCase
|
||||
|
||||
public function testSize(): void
|
||||
{
|
||||
$file = new File();
|
||||
$this->assertEquals(0, $file->size());
|
||||
|
||||
$file = new File('foo');
|
||||
$this->assertEquals(3, $file->size());
|
||||
}
|
||||
|
Reference in New Issue
Block a user