aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/TempManagerTest.php25
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/lib/TempManagerTest.php b/tests/lib/TempManagerTest.php
index a981338f42a..63cffc0dcae 100644
--- a/tests/lib/TempManagerTest.php
+++ b/tests/lib/TempManagerTest.php
@@ -154,34 +154,23 @@ class TempManagerTest extends \Test\TestCase {
$this->assertFalse($manager->getTemporaryFolder());
}
- public function testBuildFileNameWithPostfix(): void {
+ public function testGenerateTemporaryPathWithPostfix(): void {
$logger = $this->createMock(LoggerInterface::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
- 'buildFileNameWithSuffix',
- ['/tmp/myTemporaryFile', 'postfix']
+ 'generateTemporaryPath',
+ ['postfix']
);
- $this->assertEquals('/tmp/myTemporaryFile-.postfix', $tmpManager);
+ $this->assertStringEndsWith('.postfix', $tmpManager);
}
- public function testBuildFileNameWithoutPostfix(): void {
+ public function testGenerateTemporaryPathTraversal(): void {
$logger = $this->createMock(LoggerInterface::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
- 'buildFileNameWithSuffix',
- ['/tmp/myTemporaryFile', '']
- );
-
- $this->assertEquals('/tmp/myTemporaryFile', $tmpManager);
- }
-
- public function testBuildFileNameWithSuffixPathTraversal(): void {
- $logger = $this->createMock(LoggerInterface::class);
- $tmpManager = self::invokePrivate(
- $this->getManager($logger),
- 'buildFileNameWithSuffix',
- ['foo', '../Traversal\\../FileName']
+ 'generateTemporaryPath',
+ ['../Traversal\\../FileName']
);
$this->assertStringEndsNotWith('./Traversal\\../FileName', $tmpManager);