Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 048dd54

Browse filesBrowse files
Add 16/9 test
1 parent d054e64 commit 048dd54
Copy full SHA for 048dd54

File tree

2 files changed

+13
-2
lines changed
Filter options

2 files changed

+13
-2
lines changed
Loading

‎src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function setUp(): void
4848
$this->imageLandscape = __DIR__.'/Fixtures/test_landscape.gif';
4949
$this->imagePortrait = __DIR__.'/Fixtures/test_portrait.gif';
5050
$this->image4By3 = __DIR__.'/Fixtures/test_4by3.gif';
51+
$this->image16By9 = __DIR__.'/Fixtures/test_16by9.gif';
5152
$this->imageCorrupted = __DIR__.'/Fixtures/test_corrupted.gif';
5253
}
5354

@@ -304,18 +305,28 @@ public function testMaxRatioUsesTwoDecimalsOnly()
304305
$this->assertNoViolation();
305306
}
306307

307-
public function testMaxRatioUsesInputMoreDecimals()
308+
public function testMinRatioUsesInputMoreDecimals()
308309
{
309310
$constraint = new Image([
310311
'minRatio' => 4 / 3,
311-
'maxRatio' => 4 / 3,
312312
]);
313313

314314
$this->validator->validate($this->image4By3, $constraint);
315315

316316
$this->assertNoViolation();
317317
}
318318

319+
public function testMaxRatioUsesInputMoreDecimals()
320+
{
321+
$constraint = new Image([
322+
'maxRatio' => 16 / 9,
323+
]);
324+
325+
$this->validator->validate($this->image16By9, $constraint);
326+
327+
$this->assertNoViolation();
328+
}
329+
319330
public function testInvalidMinRatio()
320331
{
321332
$this->expectException(ConstraintDefinitionException::class);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.