Display CMS Optimierungen 03-06-2026
This commit is contained in:
parent
6c6d683b9a
commit
bebfa63e87
17 changed files with 925 additions and 133 deletions
30
tests/Feature/PublishFluxAssetsTest.php
Normal file
30
tests/Feature/PublishFluxAssetsTest.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
test('flux publish assets command copies javascript into public flux directory', function () {
|
||||
$targetDir = public_path('flux');
|
||||
|
||||
if (File::isDirectory($targetDir)) {
|
||||
File::deleteDirectory($targetDir);
|
||||
}
|
||||
|
||||
$this->artisan('flux:publish-assets')
|
||||
->assertSuccessful();
|
||||
|
||||
expect(is_file(public_path('flux/flux.js')))->toBeTrue();
|
||||
expect(is_file(public_path('flux/flux.min.js')))->toBeTrue();
|
||||
expect(filesize(public_path('flux/flux.min.js')))->toBeGreaterThan(1000);
|
||||
|
||||
File::deleteDirectory($targetDir);
|
||||
});
|
||||
|
||||
test('composer install and update publish flux assets', function () {
|
||||
$composer = json_decode((string) file_get_contents(base_path('composer.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$expectedCommand = '@php artisan flux:publish-assets --ansi --force';
|
||||
|
||||
expect($composer['scripts']['post-install-cmd'] ?? [])->toContain($expectedCommand);
|
||||
expect($composer['scripts']['post-update-cmd'] ?? [])->toContain($expectedCommand);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue