From 7d705417a948f3aead707b097970cc31eda38725 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 15 Oct 2020 12:41:49 -0400 Subject: [PATCH] Adjust testModuleClass() expectations after introducing lastRoutesFileModifiedTime cache key --- tests/src/App/ModuleTest.php | 3 ++- tests/src/App/RouterTest.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/src/App/ModuleTest.php b/tests/src/App/ModuleTest.php index 03bb14b605..be49a741aa 100644 --- a/tests/src/App/ModuleTest.php +++ b/tests/src/App/ModuleTest.php @@ -178,7 +178,8 @@ class ModuleTest extends DatabaseTest $cache = \Mockery::mock(ICache::class); $cache->shouldReceive('get')->with('routerDispatchData')->andReturn('')->atMost()->once(); - $cache->shouldReceive('set')->withAnyArgs()->andReturn(false)->atMost()->once(); + $cache->shouldReceive('get')->with('lastRoutesFileModifiedTime')->andReturn('')->atMost()->once(); + $cache->shouldReceive('set')->withAnyArgs()->andReturn(false)->atMost()->twice(); $router = (new App\Router([], __DIR__ . '/../../../static/routes.config.php', $l10n, $cache)); diff --git a/tests/src/App/RouterTest.php b/tests/src/App/RouterTest.php index df1ea5e9ad..b9c23a2b23 100644 --- a/tests/src/App/RouterTest.php +++ b/tests/src/App/RouterTest.php @@ -185,7 +185,7 @@ class RouterTest extends TestCase ], ], '/post' => [ - '/it' => [Module\NodeInfo::class, [Router::POST]], + '/it' => [Module\WellKnown\NodeInfo::class, [Router::POST]], ], '/double' => [Module\Profile\Index::class, [Router::GET, Router::POST]] ], @@ -221,7 +221,7 @@ class RouterTest extends TestCase ], '', $this->l10n, $this->cache))->loadRoutes($routes); // Don't find GET - $this->assertEquals(Module\NodeInfo::class, $router->getModuleClass('/post/it')); + $this->assertEquals(Module\WellKnown\NodeInfo::class, $router->getModuleClass('/post/it')); $this->assertEquals(Module\Profile\Index::class, $router->getModuleClass('/double')); } }