summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-12-18 11:25:33 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-12-18 11:25:33 +0100
commita18c0983d5db32e98461404888200118f83011d7 (patch)
tree98bebd6795b86dc39cf1a3b14acb77b872bc2ae6 /tests
parent90b0831cec88763038e241cc4816db204c045e69 (diff)
downloadnextcloud-server-a18c0983d5db32e98461404888200118f83011d7.tar.gz
nextcloud-server-a18c0983d5db32e98461404888200118f83011d7.zip
Use TempManager instead of tmpFile
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/filesystem.php2
-rw-r--r--tests/lib/installer.php6
-rw-r--r--tests/lib/streamwrappers.php4
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php
index 328ba5f4488..db1f22f894a 100644
--- a/tests/lib/files/filesystem.php
+++ b/tests/lib/files/filesystem.php
@@ -302,7 +302,7 @@ class Filesystem extends \Test\TestCase {
\OC\Files\Filesystem::mkdir('/bar');
// \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo');
- $tmpFile = \OC_Helper::tmpFile();
+ $tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
file_put_contents($tmpFile, 'foo');
$fh = fopen($tmpFile, 'r');
// \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh);
diff --git a/tests/lib/installer.php b/tests/lib/installer.php
index c3c2f8a275e..cfad4d7f0de 100644
--- a/tests/lib/installer.php
+++ b/tests/lib/installer.php
@@ -32,7 +32,7 @@ class Test_Installer extends \Test\TestCase {
$pathOfTestApp .= '/../data/';
$pathOfTestApp .= 'testapp.zip';
- $tmp = OC_Helper::tmpFile('.zip');
+ $tmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
OC_Helper::copyr($pathOfTestApp, $tmp);
$data = array(
@@ -51,7 +51,7 @@ class Test_Installer extends \Test\TestCase {
$pathOfOldTestApp .= '/../data/';
$pathOfOldTestApp .= 'testapp.zip';
- $oldTmp = OC_Helper::tmpFile('.zip');
+ $oldTmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
OC_Helper::copyr($pathOfOldTestApp, $oldTmp);
$oldData = array(
@@ -63,7 +63,7 @@ class Test_Installer extends \Test\TestCase {
$pathOfNewTestApp .= '/../data/';
$pathOfNewTestApp .= 'testapp2.zip';
- $newTmp = OC_Helper::tmpFile('.zip');
+ $newTmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
OC_Helper::copyr($pathOfNewTestApp, $newTmp);
$newData = array(
diff --git a/tests/lib/streamwrappers.php b/tests/lib/streamwrappers.php
index 9b097535280..7175683a60b 100644
--- a/tests/lib/streamwrappers.php
+++ b/tests/lib/streamwrappers.php
@@ -55,7 +55,7 @@ class Test_StreamWrappers extends \Test\TestCase {
public function testCloseStream() {
//ensure all basic stream stuff works
$sourceFile = OC::$SERVERROOT . '/tests/data/lorem.txt';
- $tmpFile = OC_Helper::TmpFile('.txt');
+ $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('.txt');
$file = 'close://' . $tmpFile;
$this->assertTrue(file_exists($file));
file_put_contents($file, file_get_contents($sourceFile));
@@ -65,7 +65,7 @@ class Test_StreamWrappers extends \Test\TestCase {
$this->assertFalse(file_exists($file));
//test callback
- $tmpFile = OC_Helper::TmpFile('.txt');
+ $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('.txt');
$file = 'close://' . $tmpFile;
$actual = false;
$callback = function($path) use (&$actual) { $actual = $path; };