Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8094804

Browse files
Mathieu Piotmpiot
Mathieu Piot
authored andcommitted
Add Tests
1 parent067c681 commit8094804

9 files changed

+80
-0
lines changed

‎src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ protected function renderLabel(FormView $view, $label = null, array $vars = arra
6969
return (string)$this->renderer->searchAndRenderBlock($view,'label',$vars);
7070
}
7171

72+
protectedfunctionrenderHelp(FormView$view,array$vars =array())
73+
{
74+
return (string)$this->renderer->searchAndRenderBlock($view,'help',$vars);
75+
}
76+
7277
protectedfunctionrenderErrors(FormView$view)
7378
{
7479
return (string)$this->renderer->searchAndRenderBlock($view,'errors');

‎src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ protected function renderLabel(FormView $view, $label = null, array $vars = arra
8989
return (string)$this->renderer->searchAndRenderBlock($view,'label',$vars);
9090
}
9191

92+
protectedfunctionrenderHelp(FormView$view,array$vars =array())
93+
{
94+
return (string)$this->renderer->searchAndRenderBlock($view,'help',$vars);
95+
}
96+
9297
protectedfunctionrenderErrors(FormView$view)
9398
{
9499
return (string)$this->renderer->searchAndRenderBlock($view,'errors');

‎src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4HorizontalLayoutTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ protected function renderLabel(FormView $view, $label = null, array $vars = arra
7070
return (string)$this->renderer->searchAndRenderBlock($view,'label',$vars);
7171
}
7272

73+
protectedfunctionrenderHelp(FormView$view,array$vars =array())
74+
{
75+
return (string)$this->renderer->searchAndRenderBlock($view,'help',$vars);
76+
}
77+
7378
protectedfunctionrenderErrors(FormView$view)
7479
{
7580
return (string)$this->renderer->searchAndRenderBlock($view,'errors');

‎src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap4LayoutTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ protected function renderLabel(FormView $view, $label = null, array $vars = arra
9292
return (string)$this->renderer->searchAndRenderBlock($view,'label',$vars);
9393
}
9494

95+
protectedfunctionrenderHelp(FormView$view,array$vars =array())
96+
{
97+
return (string)$this->renderer->searchAndRenderBlock($view,'help',$vars);
98+
}
99+
95100
protectedfunctionrenderErrors(FormView$view)
96101
{
97102
return (string)$this->renderer->searchAndRenderBlock($view,'errors');

‎src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ protected function renderLabel(FormView $view, $label = null, array $vars = arra
179179
return (string)$this->renderer->searchAndRenderBlock($view,'label',$vars);
180180
}
181181

182+
protectedfunctionrenderHelp(FormView$view,array$vars =array())
183+
{
184+
return (string)$this->renderer->searchAndRenderBlock($view,'help',$vars);
185+
}
186+
182187
protectedfunctionrenderErrors(FormView$view)
183188
{
184189
return (string)$this->renderer->searchAndRenderBlock($view,'errors');

‎src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ protected function renderLabel(FormView $view, $label = null, array $vars = arra
9090
return (string)$this->renderer->searchAndRenderBlock($view,'label',$vars);
9191
}
9292

93+
protectedfunctionrenderHelp(FormView$view,array$vars =array())
94+
{
95+
return (string)$this->renderer->searchAndRenderBlock($view,'help',$vars);
96+
}
97+
9398
protectedfunctionrenderErrors(FormView$view)
9499
{
95100
return (string)$this->renderer->searchAndRenderBlock($view,'errors');

‎src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly
102102
);
103103
}
104104

105+
publicfunctiontestHelp()
106+
{
107+
$form =$this->factory->createNamed('name','Symfony\Component\Form\Extension\Core\Type\TextType',null, [
108+
'help' =>'Help text test!'
109+
]);
110+
$view =$form->createView();
111+
$html =$this->renderHelp($view);
112+
113+
$this->assertMatchesXpath($html,
114+
'/span
115+
[@class="help-block"]
116+
[.="[trans]Help text test![/trans]"]
117+
'
118+
);
119+
}
120+
105121
publicfunctiontestErrors()
106122
{
107123
$form =$this->factory->createNamed('name','Symfony\Component\Form\Extension\Core\Type\TextType');

‎src/Symfony/Component/Form/Tests/AbstractBootstrap4LayoutTest.php‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,22 @@ public function testLegendOnExpandedType()
151151
);
152152
}
153153

154+
publicfunctiontestHelp()
155+
{
156+
$form =$this->factory->createNamed('name','Symfony\Component\Form\Extension\Core\Type\TextType',null, [
157+
'help' =>'Help text test!'
158+
]);
159+
$view =$form->createView();
160+
$html =$this->renderHelp($view);
161+
162+
$this->assertMatchesXpath($html,
163+
'/small
164+
[@class="form-text text-muted"]
165+
[.="[trans]Help text test![/trans]"]
166+
'
167+
);
168+
}
169+
154170
publicfunctiontestErrors()
155171
{
156172
$form =$this->factory->createNamed('name','Symfony\Component\Form\Extension\Core\Type\TextType');

‎src/Symfony/Component/Form/Tests/AbstractLayoutTest.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ abstract protected function renderForm(FormView $view, array $vars = array());
113113

114114
abstractprotectedfunctionrenderLabel(FormView$view,$label =null,array$vars =array());
115115

116+
abstractprotectedfunctionrenderHelp(FormView$view,array$vars =array());
117+
116118
abstractprotectedfunctionrenderErrors(FormView$view);
117119

118120
abstractprotectedfunctionrenderWidget(FormView$view,array$vars =array());
@@ -408,6 +410,22 @@ public function testLabelFormatOnButtonId()
408410
);
409411
}
410412

413+
publicfunctiontestHelp()
414+
{
415+
$form =$this->factory->createNamed('name','Symfony\Component\Form\Extension\Core\Type\TextType',null, [
416+
'help' =>'Help text test!'
417+
]);
418+
$view =$form->createView();
419+
$html =$this->renderHelp($view);
420+
421+
$this->assertMatchesXpath($html,
422+
'/p
423+
[@class="help-text"]
424+
[.="[trans]Help text test![/trans]"]
425+
'
426+
);
427+
}
428+
411429
publicfunctiontestErrors()
412430
{
413431
$form =$this->factory->createNamed('name','Symfony\Component\Form\Extension\Core\Type\TextType');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp