diff --git a/plugins/baser-core/src/BcPlugin.php b/plugins/baser-core/src/BcPlugin.php index 8025189477..dcc449b98c 100644 --- a/plugins/baser-core/src/BcPlugin.php +++ b/plugins/baser-core/src/BcPlugin.php @@ -495,6 +495,7 @@ function(RouteBuilder $routes) { * @return RouteBuilder * @checked * @noTodo + * @unitTest */ public function frontPageRouting(RouteBuilder $routes, string $plugin) { diff --git a/plugins/baser-core/tests/TestCase/BcPluginTest.php b/plugins/baser-core/tests/TestCase/BcPluginTest.php index 6fbf64c349..bf637057f2 100644 --- a/plugins/baser-core/tests/TestCase/BcPluginTest.php +++ b/plugins/baser-core/tests/TestCase/BcPluginTest.php @@ -576,6 +576,24 @@ public function test_applyAsTheme() $this->assertEquals($updateTheme, $site->theme); } + /** + * test frontPageRouting + */ + public function testFrontPageRouting() + { + // 管理画面のプラグイン用ルーティング + $result = Router::parseRequest($this->getRequest('/baser/admin/bc-blog/blog_contents/index')); + $this->assertEquals('BlogContents', $result['controller']); + $result = Router::parseRequest($this->getRequest('/baser/admin/bc-blog/blog_contents/edit/1')); + $this->assertEquals('BlogContents', $result['controller']); + + // フロントエンドのプラグイン用ルーティング + $result = Router::parseRequest($this->getRequest('/bc-blog/blog_contents/index')); + $this->assertEquals('BlogContents', $result['controller']); + $result = Router::parseRequest($this->getRequest('/bc-blog/blog_contents/edit/1')); + $this->assertEquals('BlogContents', $result['controller']); + } + /** * test Rest API */