Skip to content

Commit

Permalink
Merge pull request #4041 from thangnnmd/unitTest_BcPlugin_frontPageRo…
Browse files Browse the repository at this point in the history
…uting

BcPlugin::frontPageRouting
  • Loading branch information
HungDV2022 authored Nov 25, 2024
2 parents 71ffb88 + 4459ecc commit 7b8309c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/BcPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ function(RouteBuilder $routes) {
* @return RouteBuilder
* @checked
* @noTodo
* @unitTest
*/
public function frontPageRouting(RouteBuilder $routes, string $plugin)
{
Expand Down
18 changes: 18 additions & 0 deletions plugins/baser-core/tests/TestCase/BcPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 7b8309c

Please sign in to comment.