forked from baserproject/basercms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix baserproject#2015 BlogPostsAdminService::getPublishLink のユニットテスト実装
- Loading branch information
Đỗ Văn Hùng
authored and
Đỗ Văn Hùng
committed
May 16, 2023
1 parent
45047fd
commit 88178f7
Showing
3 changed files
with
93 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* baserCMS : Based Website Development Project <https://basercms.net> | ||
* Copyright (c) NPO baser foundation <https://baserfoundation.org/> | ||
* | ||
* @copyright Copyright (c) NPO baser foundation | ||
* @link https://basercms.net baserCMS Project | ||
* @since 5.0.0 | ||
* @license https://basercms.net/license/index.html MIT License | ||
*/ | ||
|
||
namespace BcBlog\Test\Scenario; | ||
|
||
use BaserCore\Test\Factory\ContentFactory; | ||
use BcBlog\Test\Factory\BlogContentFactory; | ||
use BcBlog\Test\Factory\BlogPostFactory; | ||
use CakephpFixtureFactories\Scenario\FixtureScenarioInterface; | ||
|
||
/** | ||
* BlogPostsAdminScenario | ||
* | ||
* 利用する場合は、テーブルの初期化に次のフィクスチャの定義が必要 | ||
* 'plugin.BcBlog.Factory/BlogPosts', | ||
* 'plugin.BcBlog.Factory/BlogContents', | ||
* 'plugin.BaserCore.Factory/Contents', | ||
*/ | ||
class BlogPostsAdminScenario implements FixtureScenarioInterface | ||
{ | ||
|
||
/** | ||
* load | ||
*/ | ||
public function load(...$args) | ||
{ | ||
ContentFactory::make([ | ||
'id' => 100, | ||
'url' => '/index', | ||
'site_id' => 1, | ||
'status' => true, | ||
'entity_id' => 1, | ||
'plugin' => 'BcBlog', | ||
'type' => 'BlogContent', | ||
'lft' => '1', | ||
'rght' => '2', | ||
'publish_begin' => '2020-01-27 12:00:00', | ||
'publish_end' => '9000-01-27 12:00:00' | ||
])->persist(); | ||
BlogPostFactory::make(['id' => 1, 'blog_content_id' => 1, 'no' => 1, 'status' => true])->persist(); | ||
BlogContentFactory::make(['id' => 1])->persist(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters