diff --git a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php index 066f8d6acb..1a06647151 100755 --- a/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php +++ b/plugins/bc-blog/tests/TestCase/View/Helper/BlogHelperTest.php @@ -611,36 +611,36 @@ public function testPrevLink($blogContentId, $id, $posts_date, $expected) { //データ生成 ContentFactory::make(['plugin' => 'BcBlog', 'type' => 'BlogContent', 'alias_id' => 1]) - ->treeNode(3, 1, 3, 'news-2', '/news/', 3)->persist(); - BlogContentFactory::make(['id' => 3])->persist(); + ->treeNode($blogContentId, 1, 3, 'news-2', '/news/', $blogContentId)->persist(); + BlogContentFactory::make(['id' => $blogContentId])->persist(); SiteFactory::make()->main()->persist(); BlogPostFactory::make([ 'id' => 1, 'no' => 1, - 'blog_content_id' => 3, + 'blog_content_id' => $blogContentId, 'title' => 'title 1', - 'posted' => '2022-10-02 09:00:00' + 'posted' => $posts_date ])->persist(); BlogPostFactory::make([ 'id' => 2, 'no' => 2, - 'blog_content_id' => 3, + 'blog_content_id' => $blogContentId, 'title' => 'title 2', - 'posted' => '2022-10-02 09:00:00' + 'posted' => $posts_date ])->persist(); BlogPostFactory::make([ 'id' => 3, 'no' => 3, - 'blog_content_id' => 3, + 'blog_content_id' => 30, 'title' => 'title 3', - 'posted' => '2022-08-02 09:00:00' + 'posted' => $posts_date ])->persist(); //currentContentをリセット $view = new BlogFrontAppView($this->getRequest()); - $blogContent = BlogContentFactory::get(3); - $blogContent->content = ContentFactory::get(3); + $blogContent = BlogContentFactory::get($blogContentId); + $blogContent->content = ContentFactory::get($blogContentId); $view->set('blogContent', $blogContent); $this->Blog = new BlogHelper($view); @@ -651,10 +651,10 @@ public function testPrevLink($blogContentId, $id, $posts_date, $expected) public static function prevLinkDataProvider() { return [ - [1, 1, '9000-08-10 18:58:07', '≪ title 3'], - [1, 3, '1000-08-10 18:58:07', ''], - [1, 2, '9000-08-10 18:58:07', '≪ title 1'], // 存在しないブログコンテンツ - [2, 3, '1000-08-10 18:58:07', ''], + [4, 2, '9000-08-10 18:58:07', '≪ title 1'], + [4, 1, '1000-08-10 18:58:07', ''], + [3, 3, '9000-08-10 18:58:07', ''], // 存在しないブログコンテンツ + [3, 2, '1000-08-10 18:58:07', '≪ title 1'], ]; }