Skip to content

Commit 438e162

Browse files
committed
[FrameworkBundle] Fix title and placeholder rendering in php form templates.
1 parent ff06705 commit 438e162

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/AbstractLayoutTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,4 +1898,18 @@ public function testStartTagWithExtraAttributes()
18981898

18991899
$this->assertSame('<form method="get" action="http://example.com/directory" class="foobar">', $html);
19001900
}
1901+
1902+
public function testTranslatedAttributes()
1903+
{
1904+
$view = $this->factory->createNamedBuilder('name', 'form')
1905+
->add('firstName', 'text', array('attr' => array('title' => 'Foo')))
1906+
->add('lastName', 'text', array('attr' => array('placeholder' => 'Bar')))
1907+
->getForm()
1908+
->createView();
1909+
1910+
$html = $this->renderForm($view);
1911+
1912+
$this->assertMatchesXpath($html, '/form//input[@title="[trans]Foo[/trans]"]');
1913+
$this->assertMatchesXpath($html, '/form//input[@placeholder="[trans]Bar[/trans]"]');
1914+
}
19011915
}

0 commit comments

Comments
 (0)