1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-19 04:01:30 +02:00

added testSaveImageWithoutParameter

This commit is contained in:
Oliver Vogel
2014-05-18 17:51:27 +02:00
parent 27989001ee
commit 28172a9efc
2 changed files with 52 additions and 0 deletions

View File

@@ -1430,6 +1430,32 @@ class GdSystemTest extends PHPUnit_Framework_TestCase
@unlink($save_as);
}
public function testSaveImageWithoutParameter()
{
$path = 'tests/tmp/bar.png';
// create temp. test image (red)
$img = $this->manager()->canvas(16, 16, '#ff0000');
$img->save($path);
$img->destroy();
// open test image again
$img = $this->manager()->make($path);
$this->assertColorAtPosition('#ff0000', $img, 0, 0);
// fill with green and save wthout paramater
$img->fill('#00ff00');
$img->save();
$img->destroy();
// re-open test image (should be green)
$img = $this->manager()->make($path);
$this->assertColorAtPosition('#00ff00', $img, 0, 0);
$img->destroy();
@unlink($path);
}
public function testDestroy()
{
$img = $this->manager()->make('tests/images/trim.png');

View File

@@ -1412,6 +1412,32 @@ class ImagickSystemTest extends PHPUnit_Framework_TestCase
@unlink($save_as);
}
public function testSaveImageWithoutParameter()
{
$path = 'tests/tmp/bar.png';
// create temp. test image (red)
$img = $this->manager()->canvas(16, 16, '#ff0000');
$img->save($path);
$img->destroy();
// open test image again
$img = $this->manager()->make($path);
$this->assertColorAtPosition('#ff0000', $img, 0, 0);
// fill with green and save wthout paramater
$img->fill('#00ff00');
$img->save();
$img->destroy();
// re-open test image (should be green)
$img = $this->manager()->make($path);
$this->assertColorAtPosition('#00ff00', $img, 0, 0);
$img->destroy();
@unlink($path);
}
/**
* @expectedException ImagickException
*/