File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/Symfony/Component/Validator/Tests/Constraints Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ protected function setUp(): void
48
48
$ this ->imageLandscape = __DIR__ .'/Fixtures/test_landscape.gif ' ;
49
49
$ this ->imagePortrait = __DIR__ .'/Fixtures/test_portrait.gif ' ;
50
50
$ this ->image4By3 = __DIR__ .'/Fixtures/test_4by3.gif ' ;
51
+ $ this ->image16By9 = __DIR__ .'/Fixtures/test_16by9.gif ' ;
51
52
$ this ->imageCorrupted = __DIR__ .'/Fixtures/test_corrupted.gif ' ;
52
53
}
53
54
@@ -304,18 +305,28 @@ public function testMaxRatioUsesTwoDecimalsOnly()
304
305
$ this ->assertNoViolation ();
305
306
}
306
307
307
- public function testMaxRatioUsesInputMoreDecimals ()
308
+ public function testMinRatioUsesInputMoreDecimals ()
308
309
{
309
310
$ constraint = new Image ([
310
311
'minRatio ' => 4 / 3 ,
311
- 'maxRatio ' => 4 / 3 ,
312
312
]);
313
313
314
314
$ this ->validator ->validate ($ this ->image4By3 , $ constraint );
315
315
316
316
$ this ->assertNoViolation ();
317
317
}
318
318
319
+ public function testMaxRatioUsesInputMoreDecimals ()
320
+ {
321
+ $ constraint = new Image ([
322
+ 'minRatio ' => 16 / 9 ,
323
+ ]);
324
+
325
+ $ this ->validator ->validate ($ this ->image16By9 , $ constraint );
326
+
327
+ $ this ->assertNoViolation ();
328
+ }
329
+
319
330
public function testInvalidMinRatio ()
320
331
{
321
332
$ this ->expectException (ConstraintDefinitionException::class);
You can’t perform that action at this time.
0 commit comments