-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from akagane99/master
getBlockSettingValue() 追加 - Model/BlockSetting
- Loading branch information
Showing
2 changed files
with
127 additions
and
0 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,95 @@ | ||
<?php | ||
/** | ||
* BlockSetting::getBlockSettingValue()のテスト | ||
* | ||
* @author Mitsuru Mutaguchi <mutaguchi@opensource-workshop.jp> | ||
* @link http://www.netcommons.org NetCommons Project | ||
* @license http://www.netcommons.org/license.txt NetCommons License | ||
* @copyright Copyright 2014, NetCommons Project | ||
*/ | ||
|
||
App::uses('NetCommonsGetTest', 'NetCommons.TestSuite'); | ||
|
||
/** | ||
* BlockSetting::getBlockSettingValue()のテスト | ||
* | ||
* @author Mitsuru Mutaguchi <mutaguchi@opensource-workshop.jp> | ||
* @package NetCommons\Blocks\Test\Case\Model\BlockSetting | ||
*/ | ||
class BlockSettingGetBlockSettingValueTest extends NetCommonsGetTest { | ||
|
||
/** | ||
* Fixtures | ||
* | ||
* @var array | ||
*/ | ||
public $fixtures = array( | ||
'plugin.blocks.block_setting', | ||
); | ||
|
||
/** | ||
* Plugin name | ||
* | ||
* @var string | ||
*/ | ||
public $plugin = 'blocks'; | ||
|
||
/** | ||
* Model name | ||
* | ||
* @var string | ||
*/ | ||
protected $_modelName = 'BlockSetting'; | ||
|
||
/** | ||
* Method name | ||
* | ||
* @var string | ||
*/ | ||
protected $_methodName = 'getBlockSettingValue'; | ||
|
||
/** | ||
* testGetBlockSettingValue()のテスト | ||
* | ||
* @return void | ||
* @see BlockSetting::getBlockSettingValue | ||
*/ | ||
public function testGetBlockSettingValue() { | ||
//データ生成 | ||
$model = $this->_modelName; | ||
$methodName = $this->_methodName; | ||
Current::write('Plugin.key', 'dummy'); | ||
Current::write('Block.key', 'block_1'); | ||
$fieldName = 'use_workflow'; | ||
|
||
//テスト実施 | ||
$result = $this->$model->$methodName($fieldName); | ||
|
||
//チェック | ||
//debug($result); | ||
$this->assertEquals('0', $result); | ||
} | ||
|
||
/** | ||
* testGetBlockSettingValue()のテスト - 空 | ||
* | ||
* @return void | ||
* @see BlockSetting::getBlockSettingValue | ||
*/ | ||
public function testGetBlockSettingValueEmpty() { | ||
//データ生成 | ||
$model = $this->_modelName; | ||
$methodName = $this->_methodName; | ||
Current::write('Plugin.key', 'dummy'); | ||
Current::write('Block.key', 'block_xxx'); //データなし条件 | ||
$fieldName = 'use_workflow'; | ||
|
||
//テスト実施 | ||
$result = $this->$model->$methodName($fieldName); | ||
|
||
//チェック | ||
//debug($result); | ||
$this->assertEquals(null, $result); | ||
} | ||
|
||
} |