Example #1
0
 public function testGetParentFile()
 {
     $this->assertInstanceOf(File::class, $this->dir->getParentFile());
     $this->assertEquals("tests", (string) $this->dir->getParentFile()->getPath());
     $this->assertInstanceOf(File::class, $this->dirAbs->getParentFile());
     $this->assertEquals(str_replace("/IO", "", __DIR__), (string) $this->dirAbs->getParentFile()->getPath());
     $this->assertInstanceOf(File::class, $this->file->getParentFile());
     $this->assertEquals("tests/IO", (string) $this->file->getParentFile()->getPath());
     $this->assertInstanceOf(File::class, $this->fileAbs->getParentFile());
     $this->assertEquals(__DIR__, (string) $this->fileAbs->getParentFile()->getPath());
     $this->assertNull($this->fileRoot->getParentFile());
 }