-
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.
- Loading branch information
1 parent
0cd8678
commit 198273d
Showing
3 changed files
with
55 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Liip\ImagineBundle\Tests\Filter; | ||
|
||
use Liip\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader; | ||
use Liip\ImagineBundle\Tests\AbstractTest; | ||
use Imagine\Image\Box; | ||
|
||
/** | ||
* Test cases for ThumbnailFilterLoader class. | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\ThumbnailFilterLoader | ||
*/ | ||
class ThumbnailFilterLoaderTest extends AbstractTest | ||
{ | ||
/** | ||
* @dataProvider heightWidthProvider | ||
*/ | ||
public function testLoad($height, $width) | ||
{ | ||
$loader = new ThumbnailFilterLoader(); | ||
$image = $this->getMockImage(); | ||
$image->method('getSize')->willReturn(new Box(20, 50)); | ||
|
||
$options = ['size' => [$height, $width]]; | ||
|
||
$result = $loader->load($image, $options); | ||
} | ||
|
||
/** | ||
* @returns int[] | ||
*/ | ||
public function heightWidthProvider() | ||
{ | ||
return [ | ||
[100, 100], | ||
[50, 50], | ||
[1, 30], | ||
[0, 30], | ||
[30, 0], | ||
[null, 16], | ||
[37, null], | ||
[null, null] | ||
]; | ||
} | ||
} |