Skip to content

Commit b721449

Browse files
committed
chore: the namespace of the test classes is modified
1 parent a248b8a commit b721449

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/LionCommand/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function setApplication(Application $application): Kernel
6363
public function commands(array $commands): void
6464
{
6565
foreach ($commands as $command) {
66-
$this->application->add(new $command);
66+
$this->application->add(new $command());
6767
}
6868
}
6969

tests/CommandTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
declare(strict_types=1);
44

5-
namespace Test;
5+
namespace Tests;
66

77
use Lion\Command\Command;
88
use Lion\Test\Test;
99

1010
class CommandTest extends Test
1111
{
12-
const TEST = 'Test';
13-
const ERROR_OUTPUT = "\033[0;31mTest\033[0m";
14-
const SUCCESS_OUTPUT = "\033[0;32mTest\033[0m";
15-
const WARNING_OUTPUT = "\033[0;33mTest\033[0m";
16-
const INFO_OUTPUT = "\033[0;36mTest\033[0m";
17-
const PURPLE_OUTPUT = "\033[0;95mTest\033[0m";
12+
private const string TEST = 'Test';
13+
private const string ERROR_OUTPUT = "\033[0;31mTest\033[0m";
14+
private const string SUCCESS_OUTPUT = "\033[0;32mTest\033[0m";
15+
private const string WARNING_OUTPUT = "\033[0;33mTest\033[0m";
16+
private const string INFO_OUTPUT = "\033[0;36mTest\033[0m";
17+
private const string PURPLE_OUTPUT = "\033[0;95mTest\033[0m";
1818

1919
private $customCommand;
2020

2121
public function setUp(): void
2222
{
23-
$this->customCommand = new class extends Command {};
23+
$this->customCommand = new class extends Command {
24+
};
2425
}
2526

2627
public function testErrorOutput(): void

tests/KernelTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Test;
5+
namespace Tests;
66

77
use Lion\Command\Command;
88
use Lion\Command\Kernel;
@@ -13,10 +13,12 @@
1313

1414
class KernelTest extends Test
1515
{
16-
const OUTPUT = ['Example command'];
16+
private const array OUTPUT = [
17+
'Example command',
18+
];
1719

1820
private Kernel $kernel;
19-
private object $customClass;
21+
private Command $customClass;
2022

2123
public function setUp(): void
2224
{

0 commit comments

Comments
 (0)