mirror of
https://github.com/Intervention/image.git
synced 2025-08-01 11:30:16 +02:00
added tests
This commit is contained in:
@@ -63,6 +63,40 @@ class ImageTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('./tmp/foo.png', $image->basePath());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Intervention\Image\Exception\RuntimeException
|
||||
*/
|
||||
public function testGetBackupWithoutBackuo()
|
||||
{
|
||||
$image = $this->getTestImage();
|
||||
$image->getBackup();
|
||||
}
|
||||
|
||||
public function testSetGetBackup()
|
||||
{
|
||||
$image = $this->getTestImage();
|
||||
$image->setBackup('foo');
|
||||
$backup = $image->getBackup();
|
||||
$this->assertEquals('foo', $backup);
|
||||
}
|
||||
|
||||
public function testGetAllBackups()
|
||||
{
|
||||
$image = $this->getTestImage();
|
||||
$image->setBackup('foo');
|
||||
$image->setBackup('bar');
|
||||
$image->setBackup('baz');
|
||||
$backups = $image->getAllBackups();
|
||||
$this->assertEquals(array('default' => 'baz'), $backups);
|
||||
|
||||
$image = $this->getTestImage();
|
||||
$image->setBackup('foo', 'a');
|
||||
$image->setBackup('bar', 'b');
|
||||
$image->setBackup('baz', 'c');
|
||||
$backups = $image->getAllBackups();
|
||||
$this->assertEquals(array('a' => 'foo', 'b' => 'bar', 'c' => 'baz'), $backups);
|
||||
}
|
||||
|
||||
private function getTestImage()
|
||||
{
|
||||
$size = Mockery::mock('\Intervention\Image\Size', array(800, 600));
|
||||
|
Reference in New Issue
Block a user