diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php index 783ef3dc3a40..3e87c798abe7 100644 --- a/src/Illuminate/Filesystem/FilesystemAdapter.php +++ b/src/Illuminate/Filesystem/FilesystemAdapter.php @@ -148,6 +148,21 @@ public function assertMissing($path) return $this; } + /** + * Determine if a directory is empty. + * + * @param string $path + * @return $this + */ + public function assertDirectoryEmpty($path) + { + PHPUnit::assertEmpty( + $this->allFiles($path), "Directory [{$path}] is not empty." + ); + + return $this; + } + /** * Determine if a file or directory exists. *