diff --git a/tests/integration/console/AbstractCommandTest.php b/tests/integration/console/AbstractCommandTest.php new file mode 100644 index 000000000..0f8a068ef --- /dev/null +++ b/tests/integration/console/AbstractCommandTest.php @@ -0,0 +1,57 @@ +extend( + (new Extend\Console()) + ->command(CustomEchoTranslationsCommand::class) + ); + + $input = [ + 'command' => 'customEchoTranslationsCommand' + ]; + + // Arbitrary translation + $this->assertEquals('Flarum Email Test', $this->runCommand($input)); + } +} + +class CustomEchoTranslationsCommand extends AbstractCommand +{ + /** + * {@inheritdoc} + */ + protected function configure() + { + $this->setName('customEchoTranslationsCommand'); + } + + /** + * {@inheritdoc} + */ + protected function fire() + { + $translator = resolve(Translator::class); + + $this->info($translator->trans('core.emails.send_test.subject')); + } +}