Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function gatherApplicationInformation()
'Config' => static::format($this->laravel->configurationIsCached(), console: $formatCachedStatus),
'Events' => static::format($this->laravel->eventsAreCached(), console: $formatCachedStatus),
'Routes' => static::format($this->laravel->routesAreCached(), console: $formatCachedStatus),
'Views' => static::format($this->hasPhpFiles($this->laravel->storagePath('framework/views')), console: $formatCachedStatus),
'Views' => static::format($this->hasPhpFiles(config('view.compiled')), console: $formatCachedStatus),
]);

static::addToSection('Drivers', fn () => array_filter([
Expand Down
13 changes: 13 additions & 0 deletions tests/Integration/Foundation/Console/AboutCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Tests\Integration\Foundation\Console;

use Illuminate\Testing\Assert;
use Orchestra\Testbench\Attributes\WithEnv;
use Orchestra\Testbench\TestCase;

use function Orchestra\Testbench\remote;
Expand Down Expand Up @@ -40,4 +41,16 @@ public function testItCanDisplayAboutCommandAsJson()
], $output['drivers']);
});
}

#[WithEnv('VIEW_COMPILED_PATH', __DIR__.'/../../View/templates')]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like making this test depend on templates from other tests, but also I'm not sure about adding custom fixtures here as compiled views is the main concern of this about console command. I would be glad if you could help with the testing approach here.

public function testItRespectsCustomPathForCompiledViews(): void
{
$process = remote('about --json', ['APP_ENV' => 'local'])->mustRun();

tap(json_decode($process->getOutput(), true), static function (array $output) {
Assert::assertArraySubset([
'views' => true,
], $output['cache']);
});
}
}
Loading