Adjust testModuleClass() expectations after introducing lastRoutesFileModifiedTime cache key

This commit is contained in:
Hypolite Petovan 2020-10-15 12:41:49 -04:00
parent df23690a93
commit 7d705417a9
2 changed files with 4 additions and 3 deletions

View file

@ -178,7 +178,8 @@ class ModuleTest extends DatabaseTest
$cache = \Mockery::mock(ICache::class); $cache = \Mockery::mock(ICache::class);
$cache->shouldReceive('get')->with('routerDispatchData')->andReturn('')->atMost()->once(); $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)); $router = (new App\Router([], __DIR__ . '/../../../static/routes.config.php', $l10n, $cache));

View file

@ -185,7 +185,7 @@ class RouterTest extends TestCase
], ],
], ],
'/post' => [ '/post' => [
'/it' => [Module\NodeInfo::class, [Router::POST]], '/it' => [Module\WellKnown\NodeInfo::class, [Router::POST]],
], ],
'/double' => [Module\Profile\Index::class, [Router::GET, 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); ], '', $this->l10n, $this->cache))->loadRoutes($routes);
// Don't find GET // 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')); $this->assertEquals(Module\Profile\Index::class, $router->getModuleClass('/double'));
} }
} }