summaryrefslogtreecommitdiffstats
path: root/tests/lib/tempmanager.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-26 23:08:08 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-26 23:08:08 +0100
commit746be98e0387ea138c4413fb89ad7e9ee87ce7aa (patch)
tree96decc89487fed61b0a111e4d630cf668c615c99 /tests/lib/tempmanager.php
parentd082e37270f19269cd13098cb013c8543f4a1843 (diff)
parentf890c3ffb1b7f7f1b744b37426993010e0c39138 (diff)
downloadnextcloud-server-746be98e0387ea138c4413fb89ad7e9ee87ce7aa.tar.gz
nextcloud-server-746be98e0387ea138c4413fb89ad7e9ee87ce7aa.zip
Merge pull request #13654 from oparoz/tmpfile-with-extension
Keep the extension in temp files
Diffstat (limited to 'tests/lib/tempmanager.php')
-rw-r--r--tests/lib/tempmanager.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/lib/tempmanager.php b/tests/lib/tempmanager.php
index c030eef2c9e..427e260c3fb 100644
--- a/tests/lib/tempmanager.php
+++ b/tests/lib/tempmanager.php
@@ -51,7 +51,7 @@ class TempManager extends \Test\TestCase {
public function testGetFile() {
$manager = $this->getManager();
- $file = $manager->getTemporaryFile('.txt');
+ $file = $manager->getTemporaryFile('txt');
$this->assertStringEndsWith('.txt', $file);
$this->assertTrue(is_file($file));
$this->assertTrue(is_writable($file));
@@ -73,8 +73,8 @@ class TempManager extends \Test\TestCase {
public function testCleanFiles() {
$manager = $this->getManager();
- $file1 = $manager->getTemporaryFile('.txt');
- $file2 = $manager->getTemporaryFile('.txt');
+ $file1 = $manager->getTemporaryFile('txt');
+ $file2 = $manager->getTemporaryFile('txt');
$this->assertTrue(file_exists($file1));
$this->assertTrue(file_exists($file2));
@@ -105,8 +105,8 @@ class TempManager extends \Test\TestCase {
public function testCleanOld() {
$manager = $this->getManager();
- $oldFile = $manager->getTemporaryFile('.txt');
- $newFile = $manager->getTemporaryFile('.txt');
+ $oldFile = $manager->getTemporaryFile('txt');
+ $newFile = $manager->getTemporaryFile('txt');
$folder = $manager->getTemporaryFolder();
$nonOcFile = $this->baseDir . '/foo.txt';
file_put_contents($nonOcFile, 'bar');
@@ -135,7 +135,7 @@ class TempManager extends \Test\TestCase {
$logger->expects($this->once())
->method('warning')
->with($this->stringContains('Can not create a temporary file in directory'));
- $this->assertFalse($manager->getTemporaryFile('.txt'));
+ $this->assertFalse($manager->getTemporaryFile('txt'));
}
public function testLogCantCreateFolder() {