home
/
zktecojo
/
public_html
/
vendor
/
intervention
/
image
/
tests
➕ New
📤 Upload
✎ Editing:
ExifCommandTest.php
← Back
<?php use Intervention\Image\Commands\ExifCommand; class ExifCommandTest extends PHPUnit_Framework_TestCase { public function tearDown() { Mockery::close(); } public function testFetchAll() { $image = Mockery::mock('Intervention\Image\Image'); $image->dirname = __DIR__.'/images'; $image->basename = 'exif.jpg'; $command = new ExifCommand(array()); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertInternalType('array', $command->getOutput()); } public function testFetchDefined() { $image = Mockery::mock('Intervention\Image\Image'); $image->dirname = __DIR__.'/images'; $image->basename = 'exif.jpg'; $command = new ExifCommand(array('Artist')); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertEquals('Oliver Vogel', $command->getOutput()); } public function testFetchNonExisting() { $image = Mockery::mock('Intervention\Image\Image'); $image->dirname = __DIR__.'/images'; $image->basename = 'exif.jpg'; $command = new ExifCommand(array('xxx')); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertEquals(null, $command->getOutput()); } public function testFetchFromPng() { $image = Mockery::mock('Intervention\Image\Image'); $image->dirname = __DIR__.'/images'; $image->basename = 'star.png'; $command = new ExifCommand(array('Orientation')); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertEquals(null, $command->getOutput()); } public function testReturnNullOnExifReadFail() { $image = Mockery::mock('Intervention\Image\Image'); $command = new ExifCommand(array('Orientation')); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertEquals(null, $command->getOutput()); } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel