mirror of
https://github.com/ivuorinen/palette.git
synced 2026-02-21 11:53:19 +00:00
Fixed throwing errors, added tests to test them
This commit is contained in:
@@ -29,4 +29,21 @@ class PaletteTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($image, $palette->filename);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_failure_no_image()
|
||||
{
|
||||
$palette = new \ivuorinen\Palette\Palette('');
|
||||
$this->expectException(ErrorException::class);
|
||||
$this->expectExceptionMessage('Image was not provided');
|
||||
$palette->getPalette();
|
||||
}
|
||||
|
||||
public function test_failure_not_an_image()
|
||||
{
|
||||
$palette = new \ivuorinen\Palette\Palette();
|
||||
$palette->filename = 'NOT_HERE';
|
||||
$this->expectException(ErrorException::class);
|
||||
$this->expectExceptionMessage('Image ' . $palette->filename . ' is not readable');
|
||||
$palette->getPalette();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user