Skip to content

Commit

Permalink
add tests fro extended clasess
Browse files Browse the repository at this point in the history
  • Loading branch information
mozex committed May 5, 2024
1 parent 2aaae65 commit ca57720
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Feature/CommandsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Modules\First\Console\Commands\ExtendedCommand;
use Modules\First\Console\Commands\FirstValidCommand;
use Modules\First\Console\Commands\WrongCommand;
use Modules\Second\Console\Commands\BaseCommand;
Expand Down Expand Up @@ -41,6 +42,7 @@
->toContain(FirstValidCommand::class)
->toContain(SecondValidCommand::class)
->toContain(ChainedCommand::class)
->toContain(ExtendedCommand::class)
->not->toContain(WrongCommand::class)
->not->toContain(BaseCommand::class);

Expand Down
19 changes: 19 additions & 0 deletions workbench/Modules/First/Console/Commands/ExtendedCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Modules\First\Console\Commands;

use App\Console\Commands\AppCommand;

use function Laravel\Prompts\info;

class ExtendedCommand extends AppCommand
{
protected $signature = 'first:extended';

protected $description = 'Extended Command';

public function handle(): void
{
info('Extended Command');
}
}
19 changes: 19 additions & 0 deletions workbench/app/Console/Commands/AppCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

use function Laravel\Prompts\info;

class AppCommand extends Command
{
protected $signature = 'app:command';

protected $description = 'App Command';

public function handle(): void
{
info('App Command');
}
}
7 changes: 7 additions & 0 deletions workbench/config/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@
'*/Components',
],
],
AssetType::Commands->value => [
'active' => true,
'patterns' => [
'*/Console/Commands',
'../app/Console/Commands',
],
],
];

0 comments on commit ca57720

Please sign in to comment.