1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 00:40:06 +01:00

refactor and tests

This commit is contained in:
Taylor Otwell
2016-05-08 23:04:16 -05:00
parent 5685b48f36
commit 075443b763
10 changed files with 360 additions and 131 deletions

25
tests/FilesystemTest.php Normal file
View File

@@ -0,0 +1,25 @@
<?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->assertTrue(file_exists(__DIR__.'/output/file.link'));
unlink(__DIR__.'/output/file.out');
$files->removeBrokenLinksAt(__DIR__.'/output');
$this->assertFalse(file_exists(__DIR__.'/output/file.link'));
}
}