1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 00:40:06 +01:00

Add a bunch more CLI command tests (#1332)

* Wip some cli tests

* Apply fixes from StyleCI

* Test parked command

* Test forget command

* Update Filesystem::rmDirAndContents to respect symlinks

* Wip cli commands

* Apply fixes from StyleCI

* Test link command, unlink command, and secure command

* Apply fixes from StyleCI

* Add tests for unsecure, unsecure --all, secured commands

Add placeholders for the remaining CLI commands
Add nginx::restart to unsecure --all command

Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
Matt Stauffer
2022-12-30 15:07:34 -05:00
committed by GitHub
parent e60d039bd3
commit e5e0e03799
5 changed files with 363 additions and 2 deletions

View File

@@ -257,7 +257,11 @@ public function rmDirAndContents(string $path): void
$files = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($files as $file) {
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
if ($file->isLink()) {
unlink($file->getPathname());
} else {
$file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
}
}
rmdir($path);