Skip to content

Commit

Permalink
Add empty directory assertion (#41398)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBizzle committed Mar 9, 2022
1 parent 889195b commit e98ceae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Illuminate/Filesystem/FilesystemAdapter.php
Expand Up @@ -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.
*
Expand Down

0 comments on commit e98ceae

Please sign in to comment.