diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1f4219..e2eb987 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,4 @@ name: run-tests - on: [push] jobs: @@ -8,22 +7,38 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4, 8.0, 8.1, 8.2] - laravel: [8.*, 9.*, 10.*] - statamic: [3.*, 4.*] - exclude: + php: [7.4, 8.0, 8.1, 8.2, 8.3] + laravel: [8.*, 9.*, 10.*, 11.*] + statamic: [3.*, 4.*, 5.*] + exclude: - laravel: 8.* php: 8.2 - - laravel: 9.* - php: 7.4 + - laravel: 8.* + php: 8.3 + - laravel: 8.* + statamic: 5.* - laravel: 8.* statamic: 4.* + - laravel: 9.* + php: 7.4 + - laravel: 9.* + statamic: 5.* - laravel: 10.* statamic: 3.* - laravel: 10.* php: 7.4 - laravel: 10.* php: 8.0 + - laravel: 11.* + php: 7.4 + - laravel: 11.* + php: 8.0 + - laravel: 11.* + php: 8.1 + - laravel: 11.* + statamic: 3.* + - laravel: 11.* + statamic: 4.* dependency-version: [prefer-stable] name: P${{ matrix.php }} - L${{ matrix.laravel }} - S${{ matrix.statamic }} @@ -47,4 +62,4 @@ jobs: run: composer require laravel/framework:${{ matrix.laravel }} statamic/cms:${{ matrix.statamic }} --prefer-dist --no-interaction --no-suggest - name: Execute tests - run: vendor/bin/phpunit \ No newline at end of file + run: vendor/bin/phpunit diff --git a/README.md b/README.md index 35fa9c7..81388fd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/swiftmade/statamic-clear-assets.svg?style=for-the-badge)](https://packagist.org/packages/swiftmade/statamic-clear-assets) ![Downloads](https://img.shields.io/packagist/dt/swiftmade/statamic-clear-assets?style=for-the-badge) + +> Supports Statamic 3, 4 and 5. + Clean up unused images and assets from your Statamic site. Saves storage, keep things tidy. The addon scans your entire `content` and `users` directory. If an asset is not referenced anywhere, it will be marked as unused. You can review the list of unused assets and delete them. diff --git a/composer.json b/composer.json index 63eb344..e3f1faa 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,14 @@ ], "require": { "php": "^7.4|^8.0", - "laravel/framework": "^7.30.3 || ^8.24 || ^9.0 || ^10.0", - "statamic/cms": "^3.0.0|^4.0" + "laravel/framework": "^7.30.3|^8.24|^9.0|^10.0|^11.0", + "statamic/cms": "^3.0.0|^4.0|^5.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.8", - "nunomaduro/collision": "^4.1 || ^5.0 || ^6.0", - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", - "phpunit/phpunit": "^9.5" + "nunomaduro/collision": "^4.1|^5.0|^6.0|^8.1", + "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.5|^10.0" }, "autoload": { "psr-4": { diff --git a/tests/TestCase.php b/tests/TestCase.php index 043641d..59f49cb 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -100,9 +100,16 @@ protected function resolveApplicationConfiguration($app) ]; foreach ($configs as $config) { + + $path = __DIR__ . "/../vendor/statamic/cms/config/{$config}.php"; + + if (!file_exists($path)) { + continue; + } + $app['config']->set( "statamic.$config", - require(__DIR__ . "/../vendor/statamic/cms/config/{$config}.php") + require($path) ); } @@ -111,7 +118,7 @@ protected function resolveApplicationConfiguration($app) protected function initializeDirectory($directory) { - if (! file_exists($directory)) { + if (!file_exists($directory)) { mkdir($directory); } }