Beispiel #1
0
 public function testCreateDirectory_NoRights()
 {
     $this->expectException(Exception::class);
     //TODO: find better way to get directory without rights
     $testDir = 'X:tmp' . gmdate('U') . rand(9999, 99999);
     \Echron\Tools\FileSystem::createDir($testDir);
 }
Beispiel #2
0
 public function testPutContent_NonExistingDir()
 {
     $this->expectException(Exception::class);
     $testFile = 'X:tmp' . DIRECTORY_SEPARATOR . 'tmp' . gmdate('U') . rand(9999, 99999) . 'txt';
     $dummyValue = 'Lorem ipsum';
     \Echron\Tools\FileSystem::putFileContent($testFile, $dummyValue);
     $content = file_get_contents($testFile);
     $this->assertEquals($dummyValue, $content);
     unlink($testFile);
 }
Beispiel #3
0
 public function testIsReadable()
 {
     \Echron\Tools\FileSystem::isReadable('tmp');
 }