]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix getMock TempManagerTest
authorRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 18:25:35 +0000 (20:25 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 7 Sep 2016 18:42:38 +0000 (20:42 +0200)
tests/lib/TempManagerTest.php

index d3f6ee1dc4738ffad1b31bd6e2fee56b0b82ee46..23d171180fdc5ba3887fa8f1440ee241e69554a1 100644 (file)
@@ -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)