aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Routing/RoutingTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Routing/RoutingTest.php')
-rw-r--r--tests/lib/AppFramework/Routing/RoutingTest.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php
index 326c156af98..ce0866f0511 100644
--- a/tests/lib/AppFramework/Routing/RoutingTest.php
+++ b/tests/lib/AppFramework/Routing/RoutingTest.php
@@ -74,7 +74,10 @@ class RoutingTest extends \Test\TestCase
));
// router mock
- $router = $this->getMock("\OC\Route\Router", array('create'), [\OC::$server->getLogger()]);
+ $router = $this->getMockBuilder('\OC\Route\Router')
+ ->setMethods(['create'])
+ ->setConstructorArgs([\OC::$server->getLogger()])
+ ->getMock();
// load route configuration
$container = new DIContainer('app1');
@@ -124,7 +127,10 @@ class RoutingTest extends \Test\TestCase
$route = $this->mockRoute($container, $verb, $controllerName, $actionName, $requirements, $defaults);
// router mock
- $router = $this->getMock("\OC\Route\Router", array('create'), [\OC::$server->getLogger()]);
+ $router = $this->getMockBuilder('\OC\Route\Router')
+ ->setMethods(['create'])
+ ->setConstructorArgs([\OC::$server->getLogger()])
+ ->getMock();
// we expect create to be called once:
$router
@@ -148,7 +154,10 @@ class RoutingTest extends \Test\TestCase
private function assertResource($yaml, $resourceName, $url, $controllerName, $paramName)
{
// router mock
- $router = $this->getMock("\OC\Route\Router", array('create'), [\OC::$server->getLogger()]);
+ $router = $this->getMockBuilder('\OC\Route\Router')
+ ->setMethods(['create'])
+ ->setConstructorArgs([\OC::$server->getLogger()])
+ ->getMock();
// route mocks
$container = new DIContainer('app1');
@@ -214,7 +223,10 @@ class RoutingTest extends \Test\TestCase
array $requirements=array(),
array $defaults=array()
) {
- $route = $this->getMock("\OC\Route\Route", array('method', 'action', 'requirements', 'defaults'), array(), '', false);
+ $route = $this->getMockBuilder('\OC\Route\Route')
+ ->setMethods(['method', 'action', 'requirements', 'defaults'])
+ ->disableOriginalConstructor()
+ ->getMock();
$route
->expects($this->exactly(1))
->method('method')