diff --git a/src/commands/SeacmsTest.php b/src/commands/Command.php similarity index 71% rename from src/commands/SeacmsTest.php rename to src/commands/Command.php index 935bbd6..594d948 100644 --- a/src/commands/SeacmsTest.php +++ b/src/commands/Command.php @@ -9,29 +9,15 @@ namespace Seacms\Command; use Composer\Command\BaseCommand; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** * Command to lauch tests from command line accross all seacms dependencies */ - class SeacmsTest extends BaseCommand + class Command extends BaseCommand { - /** - * @var string|null The default command name - */ - protected static $defaultName = 'seacms-test'; - - /** - * overwrite default __construct to be abel to receive array - * @param array|string|null $args - */ - public function __construct(string $name = null) - { - $name = is_string($args) ? $args : null; - parent::__construct($name); - } - /** * set name */ @@ -44,8 +30,8 @@ use Symfony\Component\Console\Output\OutputInterface; // the full command description shown when running the command with // the "--help" option - // ->setHelp("Test seacms via command line.\n". - // "(Only if phpunit available)\n") + ->setHelp("Test seacms via command line.\n". + "(Only if phpunit available)\n") ->addOption('toto', '', InputOption::VALUE_NONE, 'Display toto text') ->addOption('text', 't', InputOption::VALUE_REQUIRED, 'Display the text') @@ -64,7 +50,7 @@ use Symfony\Component\Console\Output\OutputInterface; $output->writeln('Testing seacms'); $totoOption = $input->getOption('toto'); - $textOption = $input->getOption('test'); + $textOption = $input->getOption('text'); if ($totoOption){ $output->writeln('toto'); diff --git a/src/commands/CommandProvider.php b/src/commands/CommandProvider.php new file mode 100644 index 0000000..ce10137 --- /dev/null +++ b/src/commands/CommandProvider.php @@ -0,0 +1,25 @@ + 'Seacms\\Command\\SeacmsTest', + 'Composer\Plugin\Capability\CommandProvider' => 'Seacms\\Command\\CommandProvider', ]; } /* === implements EventsSubscriberInterface === */