Esempio n. 1
0
 public function testTrailingSlash()
 {
     $p = new Path('stairway/to/hell');
     $this->assertFalse($p->hasTrailingSeparator());
     $p->addTrailingSeparator();
     $this->assertTrue($p->hasTrailingSeparator());
     $p->removeTrailingSeparator();
     $this->assertFalse($p->hasTrailingSeparator());
 }
Esempio n. 2
0
 /**
  * Makes the path relative to another given path
  * 
  * @param Path $base
  * @return Path the new relative path
  */
 public function makeRelativeTo(Path $base)
 {
     $pathname = clone $this->pathname;
     return new Path($pathname->replace($base->removeTrailingSeparator()->getPathname(), ''));
 }