Skip to content

Commit

Permalink
Use a command that doesn't do anything in these tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Nov 28, 2024
1 parent 63f52d7 commit 1a2909e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/Console/PleaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use PHPUnit\Framework\Attributes\Test;
use Statamic\Console\Please\Kernel;
use Statamic\Facades\StaticCache;
use Symfony\Component\Console\Exception\CommandNotFoundException;
use Tests\TestCase;

Expand All @@ -20,30 +19,26 @@ public function setUp(): void
#[Test]
public function it_can_run_an_artisan_command_with_statamic_prefix()
{
StaticCache::shouldReceive('flush')->once();
$this->artisan('statamic:static:clear');
$this->artisan('statamic:flat:camp');
}

#[Test]
public function statamic_prefixed_commands_will_throw_exception_when_running_in_artisan_without_prefix()
{
StaticCache::shouldReceive('flush')->never();
$this->expectException(CommandNotFoundException::class);
$this->artisan('static:clear');
$this->artisan('flat:camp');
}

#[Test]
public function it_can_run_a_please_command_without_statamic_prefix()
{
StaticCache::shouldReceive('flush')->once();
$this->please('static:clear');
$this->please('flat:camp');
}

#[Test]
public function it_can_run_a_please_command_with_statamic_prefix()
{
StaticCache::shouldReceive('flush')->once();
$this->please('statamic:static:clear');
$this->please('statamic:flat:camp');
}

public function please($command, $parameters = [])
Expand Down

0 comments on commit 1a2909e

Please sign in to comment.