1
0
mirror of https://github.com/Intervention/image.git synced 2025-03-15 22:49:40 +01:00

removed last commit

This commit is contained in:
Oliver Vogel 2014-08-20 20:39:27 +02:00
parent 6b19f49183
commit f0cc7cc86c
2 changed files with 1 additions and 28 deletions

View File

@ -75,10 +75,9 @@ class Image extends File
*
* @param string $path
* @param integer $quality
* @param Closure $success
* @return Intervention\Image\Image
*/
public function save($path = null, $quality = null, $success = null)
public function save($path = null, $quality = null)
{
$path = is_null($path) ? ($this->dirname .'/'. $this->basename) : $path;
$data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
@ -93,11 +92,6 @@ class Image extends File
// set new file info
$this->setFileInfoFromPath($path);
// run callback
if (is_callable($success)) {
$success($this);
}
return $this;
}

View File

@ -43,27 +43,6 @@ class ImageTest extends PHPUnit_Framework_TestCase
@unlink($save_as);
}
public function testSaveWithCallbacl()
{
$createdByCallback = __DIR__.'/tmp/cb.txt';
$save_as = __DIR__.'/tmp/test.jpg';
$image = $this->getTestImage();
$image->getDriver()->shouldReceive('encode')->with($image, 'jpg', 85)->once()->andReturn('mock');
$imageTest = clone $this;
$image = $image->save($save_as, 85, function ($obj) use ($imageTest, $createdByCallback) {
$imageTest->assertInstanceOf('\Intervention\Image\Image', $obj);
touch($createdByCallback);
});
$this->assertInstanceOf('\Intervention\Image\Image', $image);
$this->assertFileExists($save_as);
$this->assertFileExists($createdByCallback);
$this->assertEquals($image->basename, 'test.jpg');
$this->assertEquals($image->extension, 'jpg');
$this->assertEquals($image->filename, 'test');
@unlink($save_as);
@unlink($createdByCallback);
}
public function testFilter()
{
$demoFilter = Mockery::mock('\Intervention\Image\Filters\DemoFilter', array(15));