diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-07 20:25:35 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-07 20:42:38 +0200 |
commit | 9d4729cb6a33bba37d246230a15eccf6ff8c3165 (patch) | |
tree | c5395f4ef14535daab6b5214b7011915f922b494 /tests/lib/TempManagerTest.php | |
parent | 80c519fe89857cfead7344025f2123e3b69665a8 (diff) | |
download | nextcloud-server-9d4729cb6a33bba37d246230a15eccf6ff8c3165.tar.gz nextcloud-server-9d4729cb6a33bba37d246230a15eccf6ff8c3165.zip |
Fix getMock TempManagerTest
Diffstat (limited to 'tests/lib/TempManagerTest.php')
-rw-r--r-- | tests/lib/TempManagerTest.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/lib/TempManagerTest.php b/tests/lib/TempManagerTest.php index d3f6ee1dc47..23d171180fd 100644 --- a/tests/lib/TempManagerTest.php +++ b/tests/lib/TempManagerTest.php @@ -10,6 +10,7 @@ namespace Test; use OC\Log; +use OCP\IConfig; class NullLogger extends Log { public function __construct($logger = null) { @@ -50,7 +51,7 @@ class TempManagerTest extends \Test\TestCase { $logger = new NullLogger(); } if (!$config) { - $config = $this->getMock('\OCP\IConfig'); + $config = $this->createMock(IConfig::class); $config->method('getSystemValue') ->with('tempdirectory', null) ->willReturn('/tmp'); @@ -140,7 +141,7 @@ class TempManagerTest extends \Test\TestCase { public function testLogCantCreateFile() { $this->markTestSkipped('TODO: Disable because fails on drone'); - $logger = $this->getMock('\Test\NullLogger'); + $logger = $this->createMock(NullLogger::class); $manager = $this->getManager($logger); chmod($this->baseDir, 0500); $logger->expects($this->once()) @@ -152,7 +153,7 @@ class TempManagerTest extends \Test\TestCase { public function testLogCantCreateFolder() { $this->markTestSkipped('TODO: Disable because fails on drone'); - $logger = $this->getMock('\Test\NullLogger'); + $logger = $this->createMock(NullLogger::class); $manager = $this->getManager($logger); chmod($this->baseDir, 0500); $logger->expects($this->once()) @@ -162,7 +163,7 @@ class TempManagerTest extends \Test\TestCase { } public function testBuildFileNameWithPostfix() { - $logger = $this->getMock('\Test\NullLogger'); + $logger = $this->createMock(NullLogger::class); $tmpManager = self::invokePrivate( $this->getManager($logger), 'buildFileNameWithSuffix', @@ -173,7 +174,7 @@ class TempManagerTest extends \Test\TestCase { } public function testBuildFileNameWithoutPostfix() { - $logger = $this->getMock('\Test\NullLogger'); + $logger = $this->createMock(NullLogger::class); $tmpManager = self::invokePrivate( $this->getManager($logger), 'buildFileNameWithSuffix', @@ -184,7 +185,7 @@ class TempManagerTest extends \Test\TestCase { } public function testBuildFileNameWithSuffixPathTraversal() { - $logger = $this->getMock('\Test\NullLogger'); + $logger = $this->createMock(NullLogger::class); $tmpManager = self::invokePrivate( $this->getManager($logger), 'buildFileNameWithSuffix', @@ -198,7 +199,7 @@ class TempManagerTest extends \Test\TestCase { public function testGetTempBaseDirFromConfig() { $dir = $this->getManager()->getTemporaryFolder(); - $config = $this->getMock('\OCP\IConfig'); + $config = $this->createMock(IConfig::class); $config->expects($this->once()) ->method('getSystemValue') ->with('tempdirectory', null) |