diff --git a/config/nativephp.php b/config/nativephp.php index 45f82250..fac93a42 100644 --- a/config/nativephp.php +++ b/config/nativephp.php @@ -62,7 +62,7 @@ 'cleanup_exclude_files' => [ 'content', 'node_modules', - '*/tests' + '*/tests', ], /** diff --git a/src/Notification.php b/src/Notification.php index a1da4847..578d860e 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -82,9 +82,9 @@ public function show(): self 'event' => $this->event, 'hasReply' => $this->hasReply, 'replyPlaceholder' => $this->replyPlaceholder, - 'actions' => array_map(fn(string $label) => [ + 'actions' => array_map(fn (string $label) => [ 'type' => 'button', - 'text' => $label + 'text' => $label, ], $this->actions), ]); diff --git a/tests/Command/IgnoreFilesAndFoldersTest.php b/tests/Command/IgnoreFilesAndFoldersTest.php deleted file mode 100644 index e805cc0a..00000000 --- a/tests/Command/IgnoreFilesAndFoldersTest.php +++ /dev/null @@ -1,88 +0,0 @@ -artisan('native:minify resources/app'); - $this->assertFalse(file_exists($laravelLog)); - - // Clean up after ourselves - if (file_exists($laravelLog)) { - unlink($laravelLog); - } - if (file_exists('resources/app/storage/logs')) { - rmdir('resources/app/storage/logs'); - } - if (file_exists('resources/app/storage')) { - rmdir('resources/app/storage'); - } - removeAppFolder(); -}); - -it('will remove the content folder by default before building', function () { - $contentPath = 'resources/app/content'; - - // Create a dummy copy of the folder - if (! file_exists($contentPath)) { - mkdir($contentPath, 0755, true); - } - - // Run the test - $this->artisan('native:minify resources/app'); - $this->assertFalse(file_exists($contentPath)); - - // Clean up after ourselves - if (file_exists($contentPath)) { - unlink($contentPath); - } - removeAppFolder(); -}); - -it('will remove only files that match a globbed path', function () { - $wildcardPath = 'resources/app/wildcardPath'; - $yes1DeletePath = $wildcardPath.'/YES1.txt'; - $yes2DeletePath = $wildcardPath.'/YES2.txt'; - $noDeletePath = $wildcardPath.'/NO.txt'; - - config()->set('nativephp.cleanup_exclude_files', [$wildcardPath.'/YES*']); - - // Create some dummy files - if (! file_exists($wildcardPath)) { - mkdir($wildcardPath, 0755, true); - } - file_put_contents($yes1DeletePath, 'PLEASE DELETE ME'); - file_put_contents($yes2DeletePath, 'PLEASE DELETE ME TOO'); - file_put_contents($noDeletePath, 'DO NOT DELETE ME'); - - // Run the test - $this->artisan('native:minify resources/app'); - $this->assertFalse(file_exists($yes1DeletePath)); - $this->assertFalse(file_exists($yes2DeletePath)); - $this->assertTrue(file_exists($noDeletePath)); - - // Clean up after ourselves - foreach ([$yes1DeletePath, $yes2DeletePath, $noDeletePath] as $remove) { - if (file_exists($remove)) { - unlink($remove); - } - } - if (file_exists($wildcardPath)) { - rmdir($wildcardPath); - } - removeAppFolder(); -}); - -function removeAppFolder() -{ - if (file_exists('resources/app')) { - rmdir('resources/app'); - } -}