Example #1
0
 public function testGetPath()
 {
     $file = new \r8\FileSys\File();
     $this->assertNull($file->getPath());
     $file->setDir("dir/to");
     $this->assertSame("dir/to/", $file->getPath());
     $file->setDir("/dir/to/");
     $this->assertSame("/dir/to/", $file->getPath());
     $file->setExt("php");
     $this->assertSame("/dir/to/", $file->getPath());
     $file->setFilename("Example");
     $this->assertSame("/dir/to/Example.php", $file->getPath());
     $file->clearExt();
     $this->assertSame("/dir/to/Example", $file->getPath());
     $file->clearDir();
     $this->assertSame("Example", $file->getPath());
     $file->setExt("php");
     $this->assertSame("Example.php", $file->getPath());
     $file->clearFilename()->clearExt();
     $this->assertNull($file->getPath());
 }