aboutsummaryrefslogtreecommitdiff
path: root/tests/phorkie/ToolsTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-07-04 18:25:01 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-07-04 18:25:01 +0200
commitf6e177a89832ba36409ac845eb72522e051bb0f3 (patch)
treec1df7e101b30060c3cb406ef19c4c69c985a01a1 /tests/phorkie/ToolsTest.php
parent00d96cfc38f3d1d1d317ee56b4fdab0e9341e792 (diff)
downloadphorkie-f6e177a89832ba36409ac845eb72522e051bb0f3.tar.gz
phorkie-f6e177a89832ba36409ac845eb72522e051bb0f3.zip
config file setup instructions
Diffstat (limited to 'tests/phorkie/ToolsTest.php')
-rw-r--r--tests/phorkie/ToolsTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/phorkie/ToolsTest.php b/tests/phorkie/ToolsTest.php
index 7a5be16..021797d 100644
--- a/tests/phorkie/ToolsTest.php
+++ b/tests/phorkie/ToolsTest.php
@@ -33,5 +33,37 @@ class ToolsTest extends \PHPUnit_Framework_TestCase
$_SERVER['SCRIPT_NAME'] = '/new.php';
$this->assertEquals('/foo/', Tools::detectBaseUrl());
}
+
+ public function testFoldPathParentSingle()
+ {
+ $this->assertEquals(
+ '/path/to/foo',
+ Tools::foldPath('/path/to/bar/../foo')
+ );
+ }
+
+ public function testFoldPathParentDouble()
+ {
+ $this->assertEquals(
+ '/path/to/foo',
+ Tools::foldPath('/path/to/foo/bar/../../foo')
+ );
+ }
+
+ public function testFoldPathCurrentSingle()
+ {
+ $this->assertEquals(
+ '/path/to/foo/',
+ Tools::foldPath('/path/to/foo/./')
+ );
+ }
+
+ public function testFoldPathCurrentThrice()
+ {
+ $this->assertEquals(
+ '/path/to/foo/',
+ Tools::foldPath('/path/././to/foo/./')
+ );
+ }
}
?>