assertDirectoryExists($root.'/custom-storage/'.$path); } $this->assertDirectoryExists($root.'/bootstrap/cache'); $file = $root.'/custom-storage/framework/views/existing.php'; file_put_contents($file, 'preserved'); $prepare($root, $root.'/custom-storage'); $this->assertSame('preserved', file_get_contents($file)); $this->assertNotFalse(realpath($root.'/custom-storage/framework/views')); } finally { (new Filesystem)->deleteDirectory($root); } } public function test_a_file_blocking_a_runtime_directory_produces_an_actionable_error(): void { $root = sys_get_temp_dir().'/investmoz-runtime-'.bin2hex(random_bytes(8)); mkdir($root, 0775, true); file_put_contents($root.'/storage', 'preserved'); $prepare = require dirname(__DIR__, 2).'/bootstrap/storage.php'; try { $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('Cannot create Laravel runtime directory:'); $prepare($root, $root.'/storage'); } finally { $this->assertSame('preserved', file_get_contents($root.'/storage')); (new Filesystem)->deleteDirectory($root); } } }