File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 2020 "require-dev" : {
2121 "friendsofphp/php-cs-fixer" : " ^3.8" ,
2222 "nunomaduro/collision" : " ^4.1|^5.0|^6.0|^8.1" ,
23- "orchestra/testbench" : " ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0" ,
23+ "orchestra/testbench" : " ^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 " ,
2424 "phpunit/phpunit" : " ^9.5|^10.0|^11.0"
2525 },
2626 "autoload" : {
Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ class ServiceProvider extends AddonServiceProvider
88{
99 public function bootAddon ()
1010 {
11+ /**
12+ * bootConfig() does not get called during unit tests,
13+ * so we manually merge the config here.
14+ */
15+ if (app ()->runningUnitTests ()) {
16+ $ this ->mergeConfigFrom (
17+ __DIR__ . '/../config/statamic-clear-assets.php ' ,
18+ 'statamic-clear-assets '
19+ );
20+ }
21+
1122 $ this ->commands ([
1223 ClearAssets::class,
1324 ]);
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ public function it_can_list_unused_assets()
5656 */
5757 public function it_ignores_containers ()
5858 {
59+ // These two assets are in ignored containers by default
5960 $ this ->createAsset ('ankara.jpg ' , 'social_images ' );
6061 $ this ->createAsset ('tallinn.jpg ' , 'favicons ' );
6162
@@ -127,7 +128,7 @@ public function it_skips_confirmation_in_no_interaction_mode()
127128
128129 private function createAsset ($ filename , $ container = 'assets ' )
129130 {
130- $ tmpFile = tempnam (sys_get_temp_dir (), ' test_ ' . $ filename );
131+ $ tmpFile = tempnam (sys_get_temp_dir (), $ filename );
131132 copy (__DIR__ . '/fixtures/ ' . $ filename , $ tmpFile );
132133
133134 $ file = new UploadedFile (
You can’t perform that action at this time.
0 commit comments