Skip to content

Commit b9a1edd

Browse files
Merge branch '3.4' into 4.1
* 3.4: [HttpFoundation] Check file exists before unlink [Console] Fixed #29835: ConfirmationQuestion with default true for answer '0' [Translation] Concatenated translation messages [Form] ensure compatibility with older PHPUnit mocks [Serializer] Docblock about throwing exceptions on serializer [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
2 parents 7e37483 + bd0bd5f commit b9a1edd

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Tests/Extension/AbstractBootstrap3LayoutTest.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,13 +2402,29 @@ public function testTimezoneWithPlaceholder()
24022402
);
24032403
}
24042404

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

24102410
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
24112411
'/input
2412+
[@type="text"]
2413+
[@name="name"]
2414+
[@class="my&class form-control"]
2415+
[@value="http://www.google.com?foo1=bar1&foo2=bar2"]
2416+
[@inputmode="url"]
2417+
'
2418+
);
2419+
}
2420+
2421+
public function testUrlWithoutDefaultProtocol()
2422+
{
2423+
$url = 'http://www.google.com?foo1=bar1&foo2=bar2';
2424+
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\UrlType', $url, ['default_protocol' => null]);
2425+
2426+
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
2427+
'/input
24122428
[@type="url"]
24132429
[@name="name"]
24142430
[@class="my&class form-control"]

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/asset": "~3.4|~4.0",
2424
"symfony/dependency-injection": "~3.4|~4.0",
2525
"symfony/finder": "~3.4|~4.0",
26-
"symfony/form": "^4.1.5",
26+
"symfony/form": "^4.1.11|^4.2.3",
2727
"symfony/http-foundation": "~3.4|~4.0",
2828
"symfony/http-kernel": "~3.4|~4.0",
2929
"symfony/polyfill-intl-icu": "~1.0",

0 commit comments

Comments
 (0)