This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
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.
Merge branch 'dev-5' into dev-baserproject#2773-dev5-merge
- Loading branch information
Showing
10 changed files
with
253 additions
and
14 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
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
66 changes: 66 additions & 0 deletions
66
plugins/bc-theme-file/tests/TestCase/ServiceProvider/BcThemeFileServiceProviderTest.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,66 @@ | ||
<?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 BcThemeFile\Test\TestCase\ServiceProvider; | ||
|
||
use BaserCore\TestSuite\BcTestCase; | ||
use BcThemeFile\ServiceProvider\BcThemeFileServiceProvider; | ||
use Cake\Core\Container; | ||
|
||
/** | ||
* Class BcThemeFileServiceProviderTest | ||
* @property BcThemeFileServiceProvider $Provider | ||
*/ | ||
class BcThemeFileServiceProviderTest extends BcTestCase | ||
{ | ||
/** | ||
* Set Up | ||
* | ||
* @return void | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->Provider = new BcThemeFileServiceProvider(); | ||
} | ||
|
||
/** | ||
* Tear Down | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown(): void | ||
{ | ||
unset($this->Provider); | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* Test services | ||
*/ | ||
public function testServices() | ||
{ | ||
$container = new Container(); | ||
$this->Provider->services($container); | ||
$themeFilesService = $container->get('BcThemeFile\Service\ThemeFilesServiceInterface'); | ||
$themeFilesAdminService = $container->get('BcThemeFile\Service\Admin\ThemeFilesAdminServiceInterface'); | ||
$themeFoldersService = $container->get('BcThemeFile\Service\ThemeFoldersServiceInterface'); | ||
$themeFoldersAdminService = $container->get('BcThemeFile\Service\Admin\ThemeFoldersAdminServiceInterface'); | ||
|
||
$this->assertEquals('BcThemeFile\Service\ThemeFilesService', get_class($themeFilesService)); | ||
$this->assertEquals('BcThemeFile\Service\Admin\ThemeFilesAdminService', get_class($themeFilesAdminService)); | ||
|
||
$this->assertEquals('BcThemeFile\Service\ThemeFoldersService', get_class($themeFoldersService)); | ||
$this->assertEquals('BcThemeFile\Service\Admin\ThemeFoldersAdminService', get_class($themeFoldersAdminService)); | ||
|
||
} | ||
|
||
} |
74 changes: 74 additions & 0 deletions
74
plugins/bc-theme-file/tests/TestCase/Utility/BcThemeFileUtilTest.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 BcThemeFile\Test\TestCase\Utility; | ||
|
||
use App\Application; | ||
use BaserCore\Service\UsersService; | ||
use BaserCore\Service\UsersServiceInterface; | ||
use BaserCore\TestSuite\BcTestCase; | ||
use BaserCore\Utility\BcContainerTrait; | ||
use BcThemeFile\Utility\BcThemeFileUtil; | ||
|
||
/** | ||
* Class BcThemeFileUtilTest | ||
* @property BcThemeFileUtil $BcThemeFileUtil | ||
*/ | ||
class BcThemeFileUtilTest extends BcTestCase | ||
{ | ||
/** | ||
* Trait | ||
*/ | ||
use BcContainerTrait; | ||
|
||
/** | ||
* set up | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
/** | ||
* tearDown | ||
* | ||
* @return void | ||
*/ | ||
public function tearDown(): void | ||
{ | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* test getTemplateTypeName | ||
* @dataProvider getTemplateTypeNameProvider | ||
*/ | ||
public function test_getTemplateTypeName($type, $expected) | ||
{ | ||
$rs = BcThemeFileUtil::getTemplateTypeName($type); | ||
$this->assertEquals($expected, $rs); | ||
} | ||
|
||
public function getTemplateTypeNameProvider() | ||
{ | ||
|
||
return [ | ||
['layout', 'レイアウトテンプレート'], | ||
['element', 'エレメントテンプレート'], | ||
['email', 'Eメールテンプレート'], | ||
['etc', 'コンテンツテンプレート'], | ||
['css', 'スタイルシート'], | ||
['js', 'Javascript'], | ||
['img', 'イメージ'], | ||
['other', false], | ||
]; | ||
} | ||
} |