1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 20:28:21 +01:00
intervention_image/tests/ExifCommandTest.php
Oliver Vogel 9bb6b213c2 v2
2014-05-10 20:35:01 +02:00

48 lines
1.5 KiB
PHP

<?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());
}
}