Skip to content

Commit adfe2d0

Browse files
Merge branch '4.2'
* 4.2: [HttpFoundation] Check file exists before unlink [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0' [Cache] PDO-based cache pool table autocreation does not work [Translation] Concatenated translation messages [Form] ensure compatibility with older PHPUnit mocks [Serializer] Docblock about throwing exceptions on serializer [Cache] fix used variable name [Debug][ErrorHandler] Preserve our error handler when a logger set another one [Form] Changed UrlType input type to text when default_protocol is not null [Bugfix] MemcachedSessionHandler::close() must close connection Always pass $key to NullAdapter->createCacheItem
2 parents cfe9cb2 + 0d90dc3 commit adfe2d0

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,13 +2505,29 @@ public function testTimezoneWithPlaceholder()
25052505
);
25062506
}
25072507

2508-
public function testUrl()
2508+
public function testUrlWithDefaultProtocol()
25092509
{
25102510
$url = 'http://www.google.com?foo1=bar1&foo2=bar2';
2511-
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url);
2511+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url, ['default_protocol' => 'http']);
25122512

25132513
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
25142514
'/input
2515+
[@type="text"]
2516+
[@name="name"]
2517+
[@class="my&class form-control"]
2518+
[@value="http://www.google.com?foo1=bar1&foo2=bar2"]
2519+
[@inputmode="url"]
2520+
'
2521+
);
2522+
}
2523+
2524+
public function testUrlWithoutDefaultProtocol()
2525+
{
2526+
$url = 'http://www.google.com?foo1=bar1&foo2=bar2';
2527+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url, ['default_protocol' => null]);
2528+
2529+
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
2530+
'/input
25152531
[@type="url"]
25162532
[@name="name"]
25172533
[@class="my&class form-control"]

0 commit comments

Comments
 (0)