-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #787 from antoligy/list-deprecation
List deprecation - closes #731
- Loading branch information
Showing
16 changed files
with
423 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ php: | |
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- hhvm | ||
|
||
sudo: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace Liip\ImagineBundle\Tests\Filter; | ||
|
||
use Liip\ImagineBundle\Imagine\Filter\Loader\CropFilterLoader; | ||
use Liip\ImagineBundle\Tests\AbstractTest; | ||
use Imagine\Image\Box; | ||
use Imagine\Image\Point; | ||
|
||
/** | ||
* Test cases for CropFilterLoader class. | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\CropFilterLoader | ||
* | ||
* @author Alex Wilson <[email protected]> | ||
*/ | ||
class CropFilterLoaderTest extends AbstractTest | ||
{ | ||
/** | ||
* @param int[] $coordinates | ||
* @param int[] $area | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\CropFilterLoader::load | ||
* | ||
* @dataProvider cropDataProvider | ||
*/ | ||
public function testLoad($coordinates, $area) | ||
{ | ||
$x = $coordinates[0]; | ||
$y = $coordinates[1]; | ||
|
||
$width = $area[0]; | ||
$height = $area[1]; | ||
|
||
$loader = new CropFilterLoader(); | ||
|
||
$image = $this->getMockImage(); | ||
$image->expects($this->once()) | ||
->method('crop') | ||
->with(new Point($x, $y), new Box($width, $height)) | ||
->willReturn($image); | ||
|
||
$options = array(); | ||
$options['start'] = $coordinates; | ||
$options['size'] = $area; | ||
|
||
$result = $loader->load($image, $options); | ||
} | ||
|
||
/** | ||
* @returns array Array containing coordinate and width/height pairs. | ||
*/ | ||
public function cropDataProvider() | ||
{ | ||
return array( | ||
array(array(140, 130), array(200, 129)), | ||
array(array(30, 60), array(50, 50)), | ||
array(array(400, 500), array(1, 30)), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
namespace Liip\ImagineBundle\Tests\Filter; | ||
|
||
use Liip\ImagineBundle\Imagine\Filter\Loader\PasteFilterLoader; | ||
use Liip\ImagineBundle\Tests\AbstractTest; | ||
use Imagine\Image\Box; | ||
use Imagine\Image\Point; | ||
|
||
/** | ||
* Test cases for PasteFilterLoader class. | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\PasteFilterLoader | ||
* | ||
* @author Alex Wilson <[email protected]> | ||
*/ | ||
class PasteFilterLoaderTest extends AbstractTest | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
const DUMMY_IMAGE_WIDTH = 500; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
const DUMMY_IMAGE_HEIGHT = 600; | ||
|
||
/** | ||
* @param int $x | ||
* @param int $y | ||
* @param Point $expected | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\PasteFilterLoader::load | ||
* | ||
* @dataProvider pasteProvider | ||
*/ | ||
public function testLoad($x, $y, $expected) | ||
{ | ||
$mockImageSize = new Box( | ||
self::DUMMY_IMAGE_WIDTH, | ||
self::DUMMY_IMAGE_HEIGHT | ||
); | ||
$image = $this->getMockImage(); | ||
$image->method('getSize')->willReturn($mockImageSize); | ||
$image->method('copy')->willReturn($image); | ||
$image->expects($this->once()) | ||
->method('paste') | ||
->with($image, $expected) | ||
->willReturn($image); | ||
|
||
$imagineMock = $this->createImagineMock(); | ||
$imagineMock | ||
->method('open') | ||
->willReturn($image); | ||
$loader = new PasteFilterLoader($imagineMock, ''); | ||
|
||
$options = array(); | ||
$options['start'] = array($x, $y); | ||
$options['image'] = ''; | ||
|
||
$result = $loader->load($image, $options); | ||
} | ||
|
||
/** | ||
* @returns array Array containing coordinates to paste. | ||
*/ | ||
public function pasteProvider() | ||
{ | ||
return array( | ||
array(200, 129, new Point(200, 129)), | ||
array(50, 50, new Point(50, 50)), | ||
array(1, 30, new Point(1, 30)), | ||
); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace Liip\ImagineBundle\Tests\Filter; | ||
|
||
use Liip\ImagineBundle\Imagine\Filter\Loader\ResizeFilterLoader; | ||
use Liip\ImagineBundle\Tests\AbstractTest; | ||
use Imagine\Image\Box; | ||
|
||
/** | ||
* Test cases for ResizeFilterLoader class. | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\ResizeFilterLoader | ||
* | ||
* @author Alex Wilson <[email protected]> | ||
*/ | ||
class ResizeFilterLoaderTest extends AbstractTest | ||
{ | ||
/** | ||
* @param int $width | ||
* @param int $height | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\ResizeFilterLoader::load | ||
* | ||
* @dataProvider resizeDataProvider | ||
*/ | ||
public function testLoad($width, $height) | ||
{ | ||
$loader = new ResizeFilterLoader(); | ||
|
||
$image = $this->getMockImage(); | ||
$image->expects($this->once()) | ||
->method('resize') | ||
->with(new Box($width, $height)) | ||
->willReturn($image); | ||
|
||
$options = array(); | ||
$options['size'] = array($width, $height); | ||
|
||
$result = $loader->load($image, $options); | ||
} | ||
|
||
/** | ||
* @returns array Array containing width/height pairs. | ||
*/ | ||
public function resizeDataProvider() | ||
{ | ||
return array( | ||
array(140, 130), | ||
array(30, 60), | ||
array(400, 500), | ||
); | ||
} | ||
} |
Oops, something went wrong.