summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-07-01 09:45:46 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2020-07-07 12:33:22 +0200
commitedc1c77dd917e232840084dd3917df62c06eb25b (patch)
tree61e75d849e068403d43bf3af61c8b54816b695c6 /tests
parentcd7a6276f27e641cfa8f835c53cd3781e69d1d67 (diff)
downloadnextcloud-server-edc1c77dd917e232840084dd3917df62c06eb25b.tar.gz
nextcloud-server-edc1c77dd917e232840084dd3917df62c06eb25b.zip
Do not create a RouteActionHandler object for each route
This is not required and doesn't allow us to be properly lazy. On top of it this doesnt allow us to cache the routes (since closures/objects can't be cached). This is the first small step into cleaning up the routing we have Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/AppFramework/Routing/RoutingTest.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/lib/AppFramework/Routing/RoutingTest.php b/tests/lib/AppFramework/Routing/RoutingTest.php
index 34aaff82310..c078023e653 100644
--- a/tests/lib/AppFramework/Routing/RoutingTest.php
+++ b/tests/lib/AppFramework/Routing/RoutingTest.php
@@ -3,7 +3,6 @@
namespace Test\AppFramework\Routing;
use OC\AppFramework\DependencyInjection\DIContainer;
-use OC\AppFramework\Routing\RouteActionHandler;
use OC\AppFramework\Routing\RouteConfig;
use OC\Route\Route;
use OC\Route\Router;
@@ -420,7 +419,7 @@ class RoutingTest extends \Test\TestCase {
array $defaults=[]
) {
$route = $this->getMockBuilder(Route::class)
- ->onlyMethods(['method', 'action', 'requirements', 'defaults'])
+ ->onlyMethods(['method', 'setDefault', 'requirements', 'defaults'])
->disableOriginalConstructor()
->getMock();
$route
@@ -431,8 +430,8 @@ class RoutingTest extends \Test\TestCase {
$route
->expects($this->once())
- ->method('action')
- ->with($this->equalTo(new RouteActionHandler($container, $controllerName, $actionName)))
+ ->method('setDefault')
+ ->with('caller', ['app1', $controllerName, $actionName])
->willReturn($route);
if (count($requirements) > 0) {