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:
parent
6b19f49183
commit
f0cc7cc86c
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user