11
11
12
12
namespace Symfony \Component \Form \Tests ;
13
13
14
+ use PHPUnit \Framework \SkippedTestError ;
14
15
use Symfony \Component \Form \FormError ;
15
16
use Symfony \Component \Form \FormView ;
16
17
use Symfony \Component \Form \Extension \Csrf \CsrfExtension ;
@@ -115,7 +116,7 @@ abstract protected function renderLabel(FormView $view, $label = null, array $va
115
116
116
117
protected function renderHelp (FormView $ view )
117
118
{
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 )));
119
120
}
120
121
121
122
abstract protected function renderErrors (FormView $ view );
@@ -445,6 +446,15 @@ public function testHelpSetLinkFromWidget()
445
446
'help ' => 'Help text test! ' ,
446
447
));
447
448
$ 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
+
448
458
$ html = $ this ->renderRow ($ view );
449
459
450
460
$ this ->assertMatchesXpath ($ html ,
@@ -458,6 +468,15 @@ public function testHelpNotSetNotLinkedFromWidget()
458
468
{
459
469
$ form = $ this ->factory ->createNamed ('name ' , 'Symfony\Component\Form\Extension\Core\Type\TextType ' );
460
470
$ 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
+
461
480
$ html = $ this ->renderRow ($ view );
462
481
463
482
$ this ->assertMatchesXpath ($ html ,
0 commit comments