writeToDir(storage_path('test.txt')); } public function testLogsDir() { $this->writeToDir(storage_path('logs/test.txt')); } public function testFrameworkDir() { $this->writeToDir(storage_path('framework/test.txt')); } public function testBootstrapCacheDir() { $this->writeToDir(storage_path('../bootstrap/cache/test.txt')); } public function testUploadDir() { $this->writeToDir(config('app.upload_path').'/test.txt'); } /** * Create and delete some file * * @param $path */ protected function writeToDir($file) { $content = uniqid(); $bytesWritten = file_put_contents($file, $content); // test writing $this->assertNotFalse($bytesWritten); // test deleting $deleted = @unlink($file); $this->assertTrue($deleted); } }