-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev-5' of github.com:baserproject/basercms into dev-5
- Loading branch information
Showing
7 changed files
with
111 additions
and
6 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
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
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
74 changes: 74 additions & 0 deletions
74
plugins/bc-blog/tests/TestCase/Model/Entity/BlogPostTest.php
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,74 @@ | ||
<?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\TestCase\Model\Entity; | ||
|
||
use BaserCore\TestSuite\BcTestCase; | ||
use BcBlog\Model\Entity\BlogPost; | ||
use BcBlog\Test\Scenario\BlogContentScenario; | ||
use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; | ||
|
||
/** | ||
* Class BlogPostTest | ||
*/ | ||
class BlogPostTest extends BcTestCase | ||
{ | ||
/** | ||
* Trait | ||
*/ | ||
use ScenarioAwareTrait; | ||
|
||
/** | ||
* @var BlogPost | ||
*/ | ||
public $BlogPost; | ||
|
||
/** | ||
* Set Up | ||
* | ||
* @return void | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->BlogPost = $this->getTableLocator()->get('BlogPost.BlogPosts'); | ||
} | ||
|
||
/** | ||
* Tear Down | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown(): void | ||
{ | ||
unset($this->BlogPost); | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* test _get_eyecatch | ||
*/ | ||
public function test_get_eyecatch() | ||
{ | ||
$this->loadFixtureScenario(BlogContentScenario::class, 1, 1, null, 'test', '/test'); | ||
$blogPost = new BlogPost([ | ||
'id' => 1, | ||
'blog_content_id' => 1, | ||
'no' => 1, | ||
'title' => 'blog post title', | ||
'status' => true, | ||
'eye_catch' => 'test.png' | ||
]); | ||
$_eyecatch = $this->execPrivateMethod($blogPost, '_get_eyecatch', []); | ||
$this->assertTextContains('/files/blog/1/blog_posts/test.png', $_eyecatch); | ||
} | ||
|
||
} |