Skip to content

Commit

Permalink
Merge pull request #682 from hydephp/register-hidden-cache-clear-command
Browse files Browse the repository at this point in the history
Register the cache clear command
  • Loading branch information
caendesilva authored Dec 21, 2024
2 parents 525550f + ac3322f commit 88b62a2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
NunoMaduro\LaravelConsoleSummary\SummaryCommand::class,
Symfony\Component\Console\Command\DumpCompletionCommand::class,
Symfony\Component\Console\Command\HelpCommand::class,
\Illuminate\Cache\Console\ClearCommand::class,
\Hyde\Console\Commands\DebugCommand::class,
\Torchlight\Commands\Install::class,
],
Expand Down
27 changes: 27 additions & 0 deletions tests/Feature/Commands/CacheClearCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace Hyde\Framework\Testing\Feature\Commands;

use Hyde\Testing\TestCase;
use Illuminate\Support\Facades\Cache;

/**
* @coversNothing
*/
class CacheClearCommandTest extends TestCase
{
public function testCacheClearCommand()
{
Cache::remember('foo', 60, fn () => 'bar');

$this->assertSame('bar', Cache::get('foo'));

$this->artisan('cache:clear')
->expectsOutputToContain('Application cache cleared successfully.')
->assertExitCode(0);

$this->assertNull(Cache::get('foo'));
}
}

0 comments on commit 88b62a2

Please sign in to comment.