|
@@ 124-134 (lines=11) @@
|
| 121 |
|
* @expectedException \Exception |
| 122 |
|
* @expectedExceptionCode 2 |
| 123 |
|
*/ |
| 124 |
|
public function deleteDirectoryContentsWithProtectedFile() |
| 125 |
|
{ |
| 126 |
|
$this->assertTrue(mkdir($this->topLevelDirPath)); |
| 127 |
|
|
| 128 |
|
file_put_contents($this->topLevelFilePath, 'hello dolly !'); |
| 129 |
|
|
| 130 |
|
$this->assertTrue(chmod($this->topLevelDirPath, 0555)); |
| 131 |
|
|
| 132 |
|
error_reporting(0); |
| 133 |
|
F::deleteDirectoryContents($this->topLevelDirPath); |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
/** |
| 137 |
|
* @test |
|
@@ 156-162 (lines=7) @@
|
| 153 |
|
* @test |
| 154 |
|
* @covers ::delete |
| 155 |
|
*/ |
| 156 |
|
public function deleteBasic() |
| 157 |
|
{ |
| 158 |
|
$this->assertTrue(mkdir($this->topLevelDirPath)); |
| 159 |
|
file_put_contents($this->topLevelFilePath, 'some text'); |
| 160 |
|
F::delete($this->topLevelFilePath); |
| 161 |
|
$this->assertFalse(file_exists($this->topLevelFilePath)); |
| 162 |
|
} |
| 163 |
|
|
| 164 |
|
/** |
| 165 |
|
* @test |
|
@@ 215-225 (lines=11) @@
|
| 212 |
|
* @covers ::delete |
| 213 |
|
* @expectedException \Exception |
| 214 |
|
*/ |
| 215 |
|
public function deleteProtectedFile() |
| 216 |
|
{ |
| 217 |
|
$this->assertTrue(mkdir($this->topLevelDirPath)); |
| 218 |
|
|
| 219 |
|
file_put_contents($this->topLevelFilePath, 'hello dolly !'); |
| 220 |
|
|
| 221 |
|
$this->assertTrue(chmod($this->topLevelDirPath, 0555)); |
| 222 |
|
|
| 223 |
|
error_reporting(0); |
| 224 |
|
F::delete($this->topLevelDirPath); |
| 225 |
|
} |
| 226 |
|
|
| 227 |
|
/** |
| 228 |
|
* verify basic behavior of deletePathIfEmpty(). |