aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-12 21:41:19 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-13 09:09:53 +0200
commit478b86e5e586975f96d57f6ebb6a3b5dbcbdaaea (patch)
treef60312a162224de4e213a89b70a005ae97b93674 /tests
parent2f36bbecb81081f3f509d6eeaf78ece240dbb0c0 (diff)
downloadnextcloud-server-478b86e5e586975f96d57f6ebb6a3b5dbcbdaaea.tar.gz
nextcloud-server-478b86e5e586975f96d57f6ebb6a3b5dbcbdaaea.zip
Fix getMock UrlGeneratortest
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/UrlGeneratorTest.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/lib/UrlGeneratorTest.php b/tests/lib/UrlGeneratorTest.php
index 7186c8fad80..c8d5b8ece2c 100644
--- a/tests/lib/UrlGeneratorTest.php
+++ b/tests/lib/UrlGeneratorTest.php
@@ -7,6 +7,8 @@
*/
namespace Test;
+use OCP\ICacheFactory;
+use OCP\IConfig;
/**
* Class UrlGeneratorTest
@@ -22,8 +24,8 @@ class UrlGeneratorTest extends \Test\TestCase {
*/
public function testLinkToDocRoot($app, $file, $args, $expectedResult) {
\OC::$WEBROOT = '';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $config = $this->createMock(IConfig::class);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
$urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
$result = $urlGenerator->linkTo($app, $file, $args);
@@ -37,8 +39,8 @@ class UrlGeneratorTest extends \Test\TestCase {
*/
public function testLinkToSubDir($app, $file, $args, $expectedResult) {
\OC::$WEBROOT = '/owncloud';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $config = $this->createMock(IConfig::class);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
$urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
$result = $urlGenerator->linkTo($app, $file, $args);
@@ -50,8 +52,8 @@ class UrlGeneratorTest extends \Test\TestCase {
*/
public function testLinkToRouteAbsolute($route, $expected) {
\OC::$WEBROOT = '/owncloud';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $config = $this->createMock(IConfig::class);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
$urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
$result = $urlGenerator->linkToRouteAbsolute($route);
$this->assertEquals($expected, $result);
@@ -89,8 +91,8 @@ class UrlGeneratorTest extends \Test\TestCase {
function testGetAbsoluteURLDocRoot($url, $expectedResult) {
\OC::$WEBROOT = '';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $config = $this->createMock(IConfig::class);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
$urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
$result = $urlGenerator->getAbsoluteURL($url);
@@ -105,8 +107,8 @@ class UrlGeneratorTest extends \Test\TestCase {
function testGetAbsoluteURLSubDir($url, $expectedResult) {
\OC::$WEBROOT = '/owncloud';
- $config = $this->getMock('\OCP\IConfig');
- $cacheFactory = $this->getMock('\OCP\ICacheFactory');
+ $config = $this->createMock(IConfig::class);
+ $cacheFactory = $this->createMock(ICacheFactory::class);
$urlGenerator = new \OC\URLGenerator($config, $cacheFactory);
$result = $urlGenerator->getAbsoluteURL($url);