|
@@ 113-123 (lines=11) @@
|
| 110 |
|
* @expectedException \Exception |
| 111 |
|
* @expectedExceptionCode 2 |
| 112 |
|
*/ |
| 113 |
|
public function deleteDirectoryContentsWithProtectedFile() |
| 114 |
|
{ |
| 115 |
|
$this->assertTrue(mkdir($this->topLevelDirPath)); |
| 116 |
|
|
| 117 |
|
file_put_contents($this->topLevelFilePath, 'hello dolly !'); |
| 118 |
|
|
| 119 |
|
$this->assertTrue(chmod($this->topLevelDirPath, 0555)); |
| 120 |
|
|
| 121 |
|
error_reporting(0); |
| 122 |
|
F::deleteDirectoryContents($this->topLevelDirPath); |
| 123 |
|
} |
| 124 |
|
|
| 125 |
|
/** |
| 126 |
|
* @test |
|
@@ 145-151 (lines=7) @@
|
| 142 |
|
* @test |
| 143 |
|
* @covers ::delete |
| 144 |
|
*/ |
| 145 |
|
public function deleteBasic() |
| 146 |
|
{ |
| 147 |
|
$this->assertTrue(mkdir($this->topLevelDirPath)); |
| 148 |
|
file_put_contents($this->topLevelFilePath, 'some text'); |
| 149 |
|
F::delete($this->topLevelFilePath); |
| 150 |
|
$this->assertFalse(file_exists($this->topLevelFilePath)); |
| 151 |
|
} |
| 152 |
|
|
| 153 |
|
/** |
| 154 |
|
* @test |
|
@@ 193-203 (lines=11) @@
|
| 190 |
|
* @covers ::delete |
| 191 |
|
* @expectedException \Exception |
| 192 |
|
*/ |
| 193 |
|
public function deleteProtectedFile() |
| 194 |
|
{ |
| 195 |
|
$this->assertTrue(mkdir($this->topLevelDirPath)); |
| 196 |
|
|
| 197 |
|
file_put_contents($this->topLevelFilePath, 'hello dolly !'); |
| 198 |
|
|
| 199 |
|
$this->assertTrue(chmod($this->topLevelDirPath, 0555)); |
| 200 |
|
|
| 201 |
|
error_reporting(0); |
| 202 |
|
F::delete($this->topLevelDirPath); |
| 203 |
|
} |
| 204 |
|
|
| 205 |
|
/** |
| 206 |
|
* verify basic behavior of deletePathIfEmpty(). |