1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00
Files
laravel-valet/tests/FilesystemTest.php
2016-05-27 10:36:40 -05:00

26 lines
735 B
PHP

<?php
use Valet\Filesystem;
class FilesystemTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
exec('rm -rf '.__DIR__.'/output');
mkdir(__DIR__.'/output');
touch(__DIR__.'/output/.gitkeep');
}
public function test_remove_broken_links_removes_broken_symlinks()
{
$files = new Filesystem;
file_put_contents(__DIR__.'/output/file.out', 'test');
symlink(__DIR__.'/output/file.out', __DIR__.'/output/file.link');
$this->assertFileExists(__DIR__.'/output/file.link');
unlink(__DIR__.'/output/file.out');
$files->removeBrokenLinksAt(__DIR__.'/output');
$this->assertFileNotExists(__DIR__.'/output/file.link');
}
}