File tree Expand file tree Collapse file tree 4 files changed +57
-1
lines changed
src/Stecman/Component/Symfony/Console/BashCompletion
Stecman/Component/Symfony/Console/BashCompletion Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+
3+ <phpunit backupGlobals =" false"
4+ backupStaticAttributes =" false"
5+ colors =" true"
6+ convertErrorsToExceptions =" true"
7+ convertNoticesToExceptions =" true"
8+ convertWarningsToExceptions =" true"
9+ processIsolation =" false"
10+ stopOnFailure =" false"
11+ syntaxCheck =" false"
12+ bootstrap =" tests/bootstrap.php"
13+ >
14+ <testsuites >
15+ <testsuite name =" Symfony console completion" >
16+ <directory >./tests</directory >
17+ </testsuite >
18+ </testsuites >
19+ <filter >
20+ <whitelist processUncoveredFilesFromWhitelist =" true" >
21+ <directory suffix =" .php" >src</directory >
22+ </whitelist >
23+ </filter >
24+ </phpunit >
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ protected function filterResults($array)
380380 * @param string $programName
381381 * @return string
382382 */
383- public function generateBashCompletionHook ($ programName )
383+ public function generateBashCompletionHook ($ programName = false )
384384 {
385385 global $ argv ;
386386 $ command = $ argv [0 ];
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ class CompletionHandlerTest extends PHPUnit_Framework_TestCase {
4+
5+ public function testGenerateBashCompletionHook ()
6+ {
7+ $ handler = $ this ->getCompletionHandler ();
8+
9+ $ noArg = $ handler ->generateBashCompletionHook ();
10+ $ this ->assertNotEmpty ($ noArg );
11+
12+ $ withArg = $ handler ->generateBashCompletionHook ('program ' );
13+ $ this ->assertNotEmpty ($ withArg );
14+ }
15+
16+ protected function getCompletionHandler ()
17+ {
18+ $ app = new \Symfony \Component \Console \Application ();
19+ return new \Stecman \Component \Symfony \Console \BashCompletion \CompletionHandler ($ app );
20+ }
21+
22+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ filename = __DIR__ . '/../vendor/autoload.php ' ;
4+
5+ if (!file_exists ($ filename )) {
6+ echo 'You must first install the vendors using composer. ' . PHP_EOL ;
7+ exit (1 );
8+ }
9+
10+ require_once $ filename ;
You can’t perform that action at this time.
0 commit comments