mirror of
https://github.com/Intervention/image.git
synced 2025-08-19 12:11:26 +02:00
removed last commit
This commit is contained in:
@@ -75,10 +75,9 @@ class Image extends File
|
|||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param integer $quality
|
* @param integer $quality
|
||||||
* @param Closure $success
|
|
||||||
* @return Intervention\Image\Image
|
* @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;
|
$path = is_null($path) ? ($this->dirname .'/'. $this->basename) : $path;
|
||||||
$data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
|
$data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
|
||||||
@@ -93,11 +92,6 @@ class Image extends File
|
|||||||
// set new file info
|
// set new file info
|
||||||
$this->setFileInfoFromPath($path);
|
$this->setFileInfoFromPath($path);
|
||||||
|
|
||||||
// run callback
|
|
||||||
if (is_callable($success)) {
|
|
||||||
$success($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,27 +43,6 @@ class ImageTest extends PHPUnit_Framework_TestCase
|
|||||||
@unlink($save_as);
|
@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()
|
public function testFilter()
|
||||||
{
|
{
|
||||||
$demoFilter = Mockery::mock('\Intervention\Image\Filters\DemoFilter', array(15));
|
$demoFilter = Mockery::mock('\Intervention\Image\Filters\DemoFilter', array(15));
|
||||||
|
Reference in New Issue
Block a user