示例#1
0
 public function testMutators()
 {
     $str = new Text('it');
     $this->assertEquals('let it', $str->prepend('let '));
     $this->assertEquals('let it', $str->prepend(new Text('let ')));
     $this->assertEquals('it go', $str->append(' go'));
     $this->assertEquals('it go', $str->append(new Text(' go')));
 }
示例#2
0
文件: Path.php 项目: phootwork/file
 /**
  * Returns the path obtained from the concatenation of the given path's 
  * segments/string to the end of this path.
  * 
  * @param string|Text|Path $path
  * @return Path
  */
 public function append($path)
 {
     if ($path instanceof Path) {
         $path = $path->getPathname();
     }
     if (!$this->hasTrailingSeparator()) {
         $this->addTrailingSeparator();
     }
     return new Path($this->pathname->append($path));
 }