summaryrefslogtreecommitdiffstats
path: root/tests/lib/tempmanager.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/tempmanager.php')
-rw-r--r--tests/lib/tempmanager.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/tempmanager.php b/tests/lib/tempmanager.php
index 427e260c3fb..9bedd7c401b 100644
--- a/tests/lib/tempmanager.php
+++ b/tests/lib/tempmanager.php
@@ -151,4 +151,17 @@ class TempManager extends \Test\TestCase {
->with($this->stringContains('Can not create a temporary folder in directory'));
$this->assertFalse($manager->getTemporaryFolder());
}
+
+ public function testGeneratePathTraversal() {
+ $logger = $this->getMock('\Test\NullLogger');
+ $tmpManager = \Test_Helper::invokePrivate(
+ $this->getManager($logger),
+ 'generatePath',
+ ['../Traversal\\../FileName']
+ );
+
+ $this->assertStringEndsNotWith('./Traversal\\../FileName', $tmpManager);
+ $this->assertStringEndsWith('.Traversal..FileName', $tmpManager);
+
+ }
}