Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions TestSuite/NetCommonsControllerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected function _testActionOnValidationError($method, $data, $urlOptions, $va
*
* @param string $mockModel Mockのモデル
* @param string $mockMethod Mockのメソッド
* @param int $count Mockの呼び出し回数
* @param int|string $count Mockの呼び出し回数
* @return void
*/
protected function _mockForReturnFalse($mockModel, $mockMethod, $count = 1) {
Expand All @@ -226,7 +226,7 @@ protected function _mockForReturnFalse($mockModel, $mockMethod, $count = 1) {
*
* @param string $mockModel Mockのモデル
* @param string $mockMethod Mockのメソッド
* @param int $count Mockの呼び出し回数
* @param int|string $count Mockの呼び出し回数
* @return void
*/
protected function _mockForReturnTrue($mockModel, $mockMethod, $count = 1) {
Expand All @@ -239,18 +239,22 @@ protected function _mockForReturnTrue($mockModel, $mockMethod, $count = 1) {
* @param string $mockModel Mockのモデル
* @param string $mockMethod Mockのメソッド
* @param bool $return 戻り値
* @param int $count Mockの呼び出し回数
* @param int|string $count Mockの呼び出し回数
* @return void
*/
protected function _mockForReturn($mockModel, $mockMethod, $return, $count = 1) {
list($mockPlugin, $mockModel) = pluginSplit($mockModel);

if (substr(get_class($this->controller->$mockModel), 0, strlen('Mock_')) !== 'Mock_') {
$this->controller->$mockModel = $this->getMockForModel(
$mockPlugin . '.' . $mockModel, array($mockMethod)
$mockPlugin . '.' . $mockModel,
array($mockMethod),
array('plugin' => Inflector::underscore($mockPlugin))
);
}
if ($count === 1) {
if ($count === 'any') {
$funcCount = $this->any();
} elseif ($count === 1) {
$funcCount = $this->once();
} else {
$funcCount = $this->exactly($count);
Expand Down