|
4 | 4 |
|
5 | 5 | namespace Onliner\ImgProxy\Options; |
6 | 6 |
|
| 7 | +use Onliner\ImgProxy\Support\GravityType; |
7 | 8 | use PHPUnit\Framework\TestCase; |
8 | 9 |
|
9 | 10 | class CropTest extends TestCase |
10 | 11 | { |
11 | 12 | /** |
12 | 13 | * @dataProvider validData |
13 | 14 | */ |
14 | | - public function testCreate(int $width, int $height, ?string $gravity, string $expected): void |
| 15 | + public function testCreate(int $width, int $height, Gravity|string|null $gravity, string $expected): void |
15 | 16 | { |
16 | 17 | $opt = new Crop($width, $height, $gravity); |
17 | 18 | $this->assertSame($expected, (string) $opt); |
@@ -61,8 +62,10 @@ public function validData(): array |
61 | 62 | [100, 200, null, 'c:100:200'], |
62 | 63 | [100, 0, 'ce', 'c:100:0:ce'], |
63 | 64 | [100, 200, 'ce', 'c:100:200:ce'], |
| 65 | + [100, 200, new Gravity(GravityType::CENTER), 'c:100:200:ce'], |
64 | 66 | [100, 200, 'ce:0:0', 'c:100:200:ce:0:0'], |
65 | 67 | [100, 200, 'ce:200:250', 'c:100:200:ce:200:250'], |
| 68 | + [100, 200, new Gravity(GravityType::CENTER, 200, 250), 'c:100:200:ce:200:250'], |
66 | 69 | ]; |
67 | 70 | } |
68 | 71 |
|
|
0 commit comments