diff --git a/TestSuite/NetCommonsControllerTestCase.php b/TestSuite/NetCommonsControllerTestCase.php index feaddfd1..a310af54 100644 --- a/TestSuite/NetCommonsControllerTestCase.php +++ b/TestSuite/NetCommonsControllerTestCase.php @@ -316,6 +316,21 @@ protected function _testActionOnValidationError($method, $data, $urlOptions, $va return $result; } +/** + * ExceptionErrorのMockセット + * + * @param string $mockModel Mockのモデル + * @param string $mockMethod Mockのメソッド + * @return void + */ + protected function _mockForReturnFalse($mockModel, $mockMethod) { + list($mockPlugin, $mockModel) = pluginSplit($mockModel); + $Mock = $this->getMockForModel($mockPlugin . '.' . $mockModel, array($mockMethod)); + $Mock->expects($this->once()) + ->method($mockMethod) + ->will($this->returnValue(false)); + } + /** * Generates a mocked controller and mocks any classes passed to `$mocks`. By * default, `_stop()` is stubbed as is sending the response headers, so to not