From 454a968f928b3c746d4ff291b754b1ed13206bf5 Mon Sep 17 00:00:00 2001 From: Julien Rosset Date: Fri, 21 Apr 2023 12:44:10 +0200 Subject: [PATCH] Create a test --- tests/Application.php | 18 +++++++++++------- tests/Commands/Hello.php | 30 ++++++++++++++++++++++++++++++ tests/run.php | 8 ++++++++ 3 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 tests/Commands/Hello.php create mode 100644 tests/run.php diff --git a/tests/Application.php b/tests/Application.php index 0a3a79c..88d0e4c 100644 --- a/tests/Application.php +++ b/tests/Application.php @@ -1,17 +1,21 @@ addAutoDiscoverySpots( + (new AutoDiscoveryDirectory(__DIR__ . '/Commands')) + ->addAutoPrefixManagers(new AutoPrefixNamespaceManager('\\jrosset\\Tests\\Commands', 'test')) + ); $this->addAutoDiscoveredCommands(); - $this->applyAutoPrefixes(); } } \ No newline at end of file diff --git a/tests/Commands/Hello.php b/tests/Commands/Hello.php new file mode 100644 index 0000000..449bc5b --- /dev/null +++ b/tests/Commands/Hello.php @@ -0,0 +1,30 @@ +writeln('Hello !'); + return Command::SUCCESS; + } +} \ No newline at end of file diff --git a/tests/run.php b/tests/run.php new file mode 100644 index 0000000..3622bfd --- /dev/null +++ b/tests/run.php @@ -0,0 +1,8 @@ +run(); \ No newline at end of file