Skip to content

Commit 728cec9

Browse files
minor #57990 [Validator] Pass required requireTld option to Url in tests (alexandre-daubois)
This PR was merged into the 7.1 branch. Discussion ---------- [Validator] Pass required `requireTld` option to `Url` in tests | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Fixes [this failure](https://github.com/symfony/symfony/actions/runs/10368087361/job/28700909856#step:8:2622) Commits ------- d93994d [Validator] Pass required `requireTld` option to `Url` in tests
2 parents 4d7e13f + d93994d commit 728cec9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testValidUrls($url)
6565
*/
6666
public function testValidUrlsWithNewLine($url)
6767
{
68-
$this->validator->validate($url."\n", new Url());
68+
$this->validator->validate($url."\n", new Url(requireTld: false));
6969

7070
$this->buildViolation('This value is not a valid URL.')
7171
->setParameter('{{ value }}', '"'.$url."\n".'"')
@@ -108,9 +108,7 @@ public function testValidRelativeUrl($url)
108108
*/
109109
public function testValidRelativeUrlWithNewLine(string $url)
110110
{
111-
$constraint = new Url([
112-
'relativeProtocol' => true,
113-
]);
111+
$constraint = new Url(relativeProtocol: true, requireTld: false);
114112

115113
$this->validator->validate($url."\n", $constraint);
116114

0 commit comments

Comments
 (0)