diff --git a/plugins/bc-blog/src/View/Helper/BlogHelper.php b/plugins/bc-blog/src/View/Helper/BlogHelper.php index 82d8560e1e..71d95638ef 100755 --- a/plugins/bc-blog/src/View/Helper/BlogHelper.php +++ b/plugins/bc-blog/src/View/Helper/BlogHelper.php @@ -1216,6 +1216,7 @@ public function isSingle() * @return boolean 現在のページがインデックスページの場合は true を返す * @checked * @noTodo + * @unitTest */ public function isHome() { diff --git a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php index 365db7005e..fccfafa390 100755 --- a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php +++ b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php @@ -1774,6 +1774,22 @@ public static function isTagDataProvider() ]; } + /** + * isHome + */ + public function test_isHome() + { + SiteFactory::make(['id' => 1])->persist(); + $this->Blog->getView()->setRequest($this->getRequest()->withAttribute('currentSite', SiteFactory::get(1))); + //param is empty + $result = $this->Blog->isHome(); + $this->assertFalse($result); + //param is not empty + $this->Blog->getView()->setRequest($this->getRequest('/news/')); + $result = $this->Blog->isHome(); + $this->assertTrue($result); + } + /** * 現在のブログタグアーカイブのブログタグ情報を取得する * @dataProvider getCurrentBlogTagDataProvider