Skip to content

Commit

Permalink
Merge pull request #1 from ShopwareAcademy/simplify
Browse files Browse the repository at this point in the history
feat: simplify things
  • Loading branch information
Isengo1989 authored Dec 20, 2024
2 parents 3787b85 + 0100ac9 commit c0e4fa9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
8 changes: 1 addition & 7 deletions src/Command/ExampleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@
)]
class ExampleCommand extends Command
{
// Provides a description, printed out in bin/console
protected function configure(): void
{
$this->setDescription('Does something very special.');
}

// Actual code executed in the command
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('It works!');

// Exit code 0 for success
return 0;
return self::SUCCESS;
}
}
16 changes: 0 additions & 16 deletions src/Resources/config/config.xml

This file was deleted.

10 changes: 4 additions & 6 deletions tests/Command/ExampleCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ class ExampleCommandTest extends TestCase
{
public function testDescriptionIsCorrect(): void
{
$application = new Application();
$command = new ExampleCommand();
$application->add($command);

$commandTester = new CommandTester($application->find('swag-commands:example'));
$commandTester = new CommandTester($command);
$commandTester->execute([]);
$commandTester->assertCommandIsSuccessful();

$this->assertSame('Does something very special.', $command->getDescription());
$this->assertSame('Add a short description for your command', $command->getDescription());
}
}
}

0 comments on commit c0e4fa9

Please sign in to comment.