getParentDirectoryPath() public method

Example #1
0
 public function testGetParentDirectoryPath()
 {
     $this->if($path = new testedClass('/', '/'))->then->object($path->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo('/')->if($path = new testedClass('/' . uniqid(), '/'))->then->object($path->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo('/')->if($path = new testedClass(($parentDirectory = '/' . uniqid()) . '/' . uniqid(), '/'))->then->object($path->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo($parentDirectory)->object($path->getParentDirectoryPath()->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo('/')->if($path = new testedClass('\\', '\\'))->then->object($path->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo('\\')->if($path = new testedClass('\\' . uniqid(), '\\'))->then->object($path->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo('\\')->if($path = new testedClass('C:\\' . uniqid(), '\\'))->then->object($path->getParentDirectoryPath())->isNotIdenticalTo($path)->toString->isEqualTo('C:\\');
 }