1111
1212namespace Symfony \Component \Form \Tests ;
1313
14+ use PHPUnit \Framework \SkippedTestError ;
1415use Symfony \Component \Form \FormError ;
1516use Symfony \Component \Form \FormView ;
1617use Symfony \Component \Form \Extension \Csrf \CsrfExtension ;
@@ -115,7 +116,7 @@ abstract protected function renderLabel(FormView $view, $label = null, array $va
115116
116117 protected function renderHelp (FormView $ view )
117118 {
118- $ this ->markTestSkipped (sprintf ('Legacy %s::renderHelp() is not implemented. ' , get_class ($ this )));
119+ $ this ->markTestSkipped (sprintf ('%s::renderHelp() is not implemented. ' , get_class ($ this )));
119120 }
120121
121122 abstract protected function renderErrors (FormView $ view );
@@ -445,6 +446,15 @@ public function testHelpSetLinkFromWidget()
445446 'help ' => 'Help text test! ' ,
446447 ));
447448 $ view = $ form ->createView ();
449+
450+ // Test if renderHelp method is implemented
451+ try {
452+ $ this ->renderHelp ($ view );
453+ }
454+ catch (SkippedTestError $ error ) {
455+ return $ error ;
456+ }
457+
448458 $ html = $ this ->renderRow ($ view );
449459
450460 $ this ->assertMatchesXpath ($ html ,
@@ -458,6 +468,15 @@ public function testHelpNotSetNotLinkedFromWidget()
458468 {
459469 $ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\TextType ' );
460470 $ view = $ form ->createView ();
471+
472+ // Test if renderHelp method is implemented
473+ try {
474+ $ this ->renderHelp ($ view );
475+ }
476+ catch (SkippedTestError $ error ) {
477+ return $ error ;
478+ }
479+
461480 $ html = $ this ->renderRow ($ view );
462481
463482 $ this ->assertMatchesXpath ($ html ,
0 commit comments