Пример #1
0
 public function testMatching()
 {
     $base = new Path('this/is/the/path/to/my/file.ext');
     $prefix = new Path('this/is/the');
     $anotherPath = new Path('this/is/another/path');
     $this->assertTrue($prefix->isPrefixOf($base));
     $this->assertEquals(3, $base->matchingFirstSegments($prefix));
     $this->assertEquals(2, $base->matchingFirstSegments($anotherPath));
     $this->assertEquals('/path/to/my/file.ext', $base->makeRelativeTo($prefix)->toString());
 }