Skip to content

Commit c99aee5

Browse files
committed
Account for new signature attribute
1 parent 058e112 commit c99aee5

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

tests/Commands/Make/MakeCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function test_it_uses_the_command_option_for_name_when_set(): void
4040
$arguments = ['name' => 'TestCommand', '--command' => 'foo:bar-baz'];
4141
$expected_path = 'src/Console/Commands/TestCommand.php';
4242
$expected_substrings = [
43-
"signature = 'foo:bar-baz'",
43+
$this->isLaravelVersion('13')
44+
? "#[Signature('foo:bar-baz')]"
45+
: "signature = 'foo:bar-baz'",
4446
];
4547

4648
$this->assertModuleCommandResults($command, $arguments, $expected_path, $expected_substrings);

tests/TestCase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,18 @@ protected function makeModule(string $name = 'test-module'): ModuleConfig
4747

4848
protected function requiresLaravelVersion(string $minimum_version, string $operator = '>=')
4949
{
50-
if (! version_compare($this->app->version(), $minimum_version, $operator)) {
50+
if (! $this->isLaravelVersion($minimum_version, $operator)) {
5151
$this->markTestSkipped("Only applies to Laravel {$operator} {$minimum_version}.");
5252
}
5353

5454
return $this;
5555
}
5656

57+
protected function isLaravelVersion(string $minimum_version, string $operator = '>='): bool
58+
{
59+
return version_compare($this->app->version(), $minimum_version, $operator);
60+
}
61+
5762
protected function getPackageProviders($app)
5863
{
5964
return [

0 commit comments

Comments
 (0)