|
@@ 33-43 (lines=11) @@
|
| 30 |
|
$this->maker = new MakeDirectory(); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function testCanMakeDirectory() |
| 34 |
|
{ |
| 35 |
|
$file = new LocalFile(static::$dir . 'test/file'); |
| 36 |
|
|
| 37 |
|
static::assertFalse(file_exists($file->getDirectory())); |
| 38 |
|
|
| 39 |
|
$retFile = $this->maker->makeDirectory($file); |
| 40 |
|
|
| 41 |
|
static::assertTrue(file_exists($file->getDirectory())); |
| 42 |
|
static::assertSame($file, $retFile); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function testCanMakeDirectoryWithSpecificUMode() |
| 46 |
|
{ |
|
@@ 45-55 (lines=11) @@
|
| 42 |
|
static::assertSame($file, $retFile); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function testCanMakeDirectoryWithSpecificUMode() |
| 46 |
|
{ |
| 47 |
|
$file = new LocalFile(static::$dir . 'umode_test/file'); |
| 48 |
|
|
| 49 |
|
static::assertFalse(file_exists($file->getDirectory())); |
| 50 |
|
|
| 51 |
|
$retFile = $this->maker->makeDirectory($file, MakeDirectory::VISIBILITY_PUBLIC); |
| 52 |
|
|
| 53 |
|
static::assertEquals(0755, fileperms($file->getDirectory()) & 0777); |
| 54 |
|
static::assertSame($retFile, $file); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
public function testCanCallMakeDirectoryWithAnExistingFolder() |
| 58 |
|
{ |
|
@@ 57-66 (lines=10) @@
|
| 54 |
|
static::assertSame($retFile, $file); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
public function testCanCallMakeDirectoryWithAnExistingFolder() |
| 58 |
|
{ |
| 59 |
|
$file = new LocalFile(static::$dir . 'no_dir_file'); |
| 60 |
|
|
| 61 |
|
static::assertTrue(file_exists($file->getDirectory())); |
| 62 |
|
|
| 63 |
|
$retFile = $this->maker->makeDirectory($file); |
| 64 |
|
|
| 65 |
|
static::assertSame($retFile, $file); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
|