Ejemplo n.º 1
0
 public function testGetterWithNonExistingUrl()
 {
     $file = new File('http://www.php.net/svn.php');
     $this->assertSame('http://www.php.net/svn.php', $file->getPath());
     $this->assertSame('svn.php', $file->getName());
     $this->assertSame('php', $file->getExtension());
 }
Ejemplo n.º 2
0
 /**
  * Tests whether removeDirectory() works correctly.
  *
  * @return void
  */
 public function testRemoveDirectory()
 {
     FileUtil::createDirectoryIfNotExists(ABLERON_TEMP_DIR . '/testRemoveDirectory/foo/bar/baz');
     $file = new File(ABLERON_TEMP_DIR . '/testRemoveDirectory/foo/bar/bar.txt');
     $file->append('foobar');
     $this->assertTrue(is_file($file->getPath()));
     FileUtil::removeDirectory(ABLERON_TEMP_DIR . '/testRemoveDirectory');
     $this->assertFalse(is_file($file->getPath()));
     $this->assertFalse(is_dir(ABLERON_TEMP_DIR . '/testRemoveDirectory'));
 }