File tree 2 files changed +7
-3
lines changed
src/Symfony/Component/Console
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ public function setHelp($help)
491
491
*/
492
492
public function getHelp ()
493
493
{
494
- return $ this ->help ?: $ this -> description ;
494
+ return $ this ->help ;
495
495
}
496
496
497
497
/**
@@ -513,7 +513,7 @@ public function getProcessedHelp()
513
513
$ _SERVER ['PHP_SELF ' ].' ' .$ name ,
514
514
);
515
515
516
- return str_replace ($ placeholders , $ replacements , $ this ->getHelp ());
516
+ return str_replace ($ placeholders , $ replacements , $ this ->getHelp () ?: $ this -> getDescription () );
517
517
}
518
518
519
519
/**
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public function testGetSetHelp()
132
132
$ this ->assertEquals ($ command , $ ret , '->setHelp() implements a fluent interface ' );
133
133
$ this ->assertEquals ('help1 ' , $ command ->getHelp (), '->setHelp() sets the help ' );
134
134
$ command ->setHelp ('' );
135
- $ this ->assertEquals ('description ' , $ command ->getHelp (), '->getHelp() fallback to the description ' );
135
+ $ this ->assertEquals ('' , $ command ->getHelp (), '->getHelp() does not fall back to the description ' );
136
136
}
137
137
138
138
public function testGetProcessedHelp ()
@@ -141,6 +141,10 @@ public function testGetProcessedHelp()
141
141
$ command ->setHelp ('The %command.name% command does... Example: php %command.full_name%. ' );
142
142
$ this ->assertContains ('The namespace:name command does... ' , $ command ->getProcessedHelp (), '->getProcessedHelp() replaces %command.name% correctly ' );
143
143
$ this ->assertNotContains ('%command.full_name% ' , $ command ->getProcessedHelp (), '->getProcessedHelp() replaces %command.full_name% ' );
144
+
145
+ $ command = new \TestCommand ();
146
+ $ command ->setHelp ('' );
147
+ $ this ->assertContains ('description ' , $ command ->getProcessedHelp (), '->getProcessedHelp() falls back to the description ' );
144
148
}
145
149
146
150
public function testGetSetAliases ()
You can’t perform that action at this time.
0 commit comments