Skip to content

Commit d93994d

Browse files
[Validator] Pass required requireTld option to Url in tests
1 parent 1f4336d commit d93994d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
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)