Skip to content

Commit 968e1a5

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [HttpFoundation] Support 0 bit netmask in IPv6 () Set `width: auto` on WebProfiler toolbar's reset. [HttpKernel] Fix logging of post-terminate errors/exceptions [Debug] Fix catching fatal errors in case of nested error handlers Fix hidden currency element with Bootstrap 3 theme
2 parents abd0b7d + f975ef0 commit 968e1a5

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Tests/AbstractBootstrap3LayoutTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,25 @@ public function testMoney()
19771977
);
19781978
}
19791979

1980+
public function testMoneyWithoutCurrency()
1981+
{
1982+
$form = $this->factory->createNamed('name', 'money', 1234.56, array(
1983+
'currency' => false,
1984+
));
1985+
1986+
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
1987+
'/input
1988+
[@id="my&id"]
1989+
[@type="text"]
1990+
[@name="name"]
1991+
[@class="my&class form-control"]
1992+
[@value="1234.56"]
1993+
[not(preceding-sibling::*)]
1994+
[not(following-sibling::*)]
1995+
'
1996+
);
1997+
}
1998+
19801999
public function testNumber()
19812000
{
19822001
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\NumberType', 1234.56);

Tests/Extension/Core/Type/MoneyTypeTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testMoneyPatternWorksForYen()
5353
$view = $this->factory->create(static::TESTED_TYPE, null, array('currency' => 'JPY'))
5454
->createView();
5555

56-
$this->assertTrue((bool) strstr($view->vars['money_pattern'], '¥'));
56+
$this->assertSame('¥ {{ widget }}', $view->vars['money_pattern']);
5757
}
5858

5959
// https://github.com/symfony/symfony/issues/5458
@@ -72,4 +72,12 @@ public function testSubmitNull($expected = null, $norm = null, $view = null)
7272
{
7373
parent::testSubmitNull($expected, $norm, '');
7474
}
75+
76+
public function testMoneyPatternWithoutCurrency()
77+
{
78+
$view = $this->factory->create(static::TESTED_TYPE, null, array('currency' => false))
79+
->createView();
80+
81+
$this->assertSame('{{ widget }}', $view->vars['money_pattern']);
82+
}
7583
}

0 commit comments

Comments
 (0)