@@ -19,6 +19,15 @@ class ViewPublishGroupTest extends UnitTestCase
1919 protected static bool $ needsKernel = true ;
2020 protected static bool $ needsConfig = true ;
2121
22+ public static string $ packageDirectory ;
23+
24+ public static function setUpBeforeClass (): void
25+ {
26+ parent ::setUpBeforeClass ();
27+
28+ self ::$ packageDirectory = is_dir (Hyde::path ('packages ' )) ? 'packages ' : 'vendor/hyde ' ;
29+ }
30+
2231 protected function setUp (): void
2332 {
2433 TestViewPublishGroup::setProvider (TestViewServiceProvider::class);
@@ -42,7 +51,7 @@ public function testCanCreateGroup()
4251 $ this ->assertSame ($ group ->group , 'layouts ' );
4352 $ this ->assertSame ($ group ->name , 'Layouts ' );
4453 $ this ->assertSame ($ group ->description , "Publish the 'layouts' files for customization. " );
45- $ this ->assertSame ($ group ->source , ' packages /framework/resources/views/layouts ' );
54+ $ this ->assertSame ($ group ->source , ViewPublishGroupTest:: $ packageDirectory . ' /framework/resources/views/layouts ' );
4655 $ this ->assertSame ($ group ->target , 'resources/views/vendor/hyde/layouts ' );
4756 $ this ->assertSame ($ group ->files , ['app.blade.php ' , 'page.blade.php ' , 'post.blade.php ' ]);
4857 }
@@ -88,7 +97,7 @@ public static function pathsToPublish($provider = null, $group = null): array
8897 ViewPublishGroupTest::assertSame ($ group , 'layouts ' );
8998
9099 return [
91- Hyde::vendorPath ( ' src/Foundation/Providers/../../../resources/views/layouts ' ) => Hyde::path ('resources/views/vendor/hyde/layouts ' ),
100+ Hyde::path (ViewPublishGroupTest:: $ packageDirectory . ' /framework/ src/Foundation/Providers/../../../resources/views/layouts ' ) => Hyde::path ('resources/views/vendor/hyde/layouts ' ),
92101 ];
93102 }
94103}
@@ -97,14 +106,14 @@ class TestFileFinder extends FileFinder
97106{
98107 public static function handle (string $ directory , array |string |false $ matchExtensions = false , bool $ recursive = false ): Collection
99108 {
100- ViewPublishGroupTest::assertSame ($ directory , ' packages /framework/resources/views/layouts ' );
109+ ViewPublishGroupTest::assertSame ($ directory , ViewPublishGroupTest:: $ packageDirectory . ' /framework/resources/views/layouts ' );
101110 ViewPublishGroupTest::assertSame ($ matchExtensions , false );
102111 ViewPublishGroupTest::assertSame ($ recursive , true );
103112
104113 return collect ([
105- ' packages /framework/resources/views/layouts/app.blade.php ' ,
106- ' packages /framework/resources/views/layouts/page.blade.php ' ,
107- ' packages /framework/resources/views/layouts/post.blade.php ' ,
114+ ViewPublishGroupTest:: $ packageDirectory . ' /framework/resources/views/layouts/app.blade.php ' ,
115+ ViewPublishGroupTest:: $ packageDirectory . ' /framework/resources/views/layouts/page.blade.php ' ,
116+ ViewPublishGroupTest:: $ packageDirectory . ' /framework/resources/views/layouts/post.blade.php ' ,
108117 ]);
109118 }
110119}
0 commit comments