Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
1.2 kB · 42 lines
PHP
12345678910111213141516171819202122232425262728293031323334353637383940414243<?php
final class DiffusionPathQueryTestCase extends PhabricatorTestCase {
public function testParentEdgeCases() { $this->assertEqual( '/', DiffusionPathIDQuery::getParentPath('/'), pht('Parent of %s', '/')); $this->assertEqual( '/', DiffusionPathIDQuery::getParentPath('x.txt'), pht('Parent of %s', 'x.txt')); $this->assertEqual( '/a', DiffusionPathIDQuery::getParentPath('/a/b'), pht('Parent of %s', '/a/b')); $this->assertEqual( '/a', DiffusionPathIDQuery::getParentPath('/a///b'), pht('Parent of %s', '/a///b')); }
public function testExpandEdgeCases() { $this->assertEqual( array('/'), DiffusionPathIDQuery::expandPathToRoot('/')); $this->assertEqual( array('/'), DiffusionPathIDQuery::expandPathToRoot('//')); $this->assertEqual( array('/a/b', '/a', '/'), DiffusionPathIDQuery::expandPathToRoot('/a/b')); $this->assertEqual( array('/a/b', '/a', '/'), DiffusionPathIDQuery::expandPathToRoot('/a//b')); $this->assertEqual( array('/a/b', '/a', '/'), DiffusionPathIDQuery::expandPathToRoot('a/b')); }
}