|
@@ 134-144 (lines=11) @@
|
| 131 |
|
* @param Description $expectation A description of the expected value |
| 132 |
|
* @throws GovernorAssertionError |
| 133 |
|
*/ |
| 134 |
|
public function reportWrongResult($actualReturnValue, |
| 135 |
|
Description $expectation) |
| 136 |
|
{ |
| 137 |
|
$str = "The command handler returned an unexpected value"; |
| 138 |
|
$str .= PHP_EOL . PHP_EOL; |
| 139 |
|
$str .= "Expected <" . $expectation . "> but got <"; |
| 140 |
|
$str .= $this->describe($actualReturnValue) . ">"; |
| 141 |
|
$str .= PHP_EOL; |
| 142 |
|
|
| 143 |
|
throw new GovernorAssertionError($str); |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
/** |
| 147 |
|
* Report an error due to an unexpected return value, while an exception was expected. |
|
@@ 153-163 (lines=11) @@
|
| 150 |
|
* @param Description $description A description describing the expected value |
| 151 |
|
* @throws GovernorAssertionError |
| 152 |
|
*/ |
| 153 |
|
public function reportUnexpectedReturnValue($actualReturnValue, |
| 154 |
|
Description $description) |
| 155 |
|
{ |
| 156 |
|
$str = "The command handler returned normally, but an exception was expected"; |
| 157 |
|
$str .= PHP_EOL . PHP_EOL; |
| 158 |
|
$str .= "Expected <" . $description . "> but returned with <" . $actualReturnValue; |
| 159 |
|
$str .= $this->describe($actualReturnValue) . ">"; |
| 160 |
|
$str .= PHP_EOL; |
| 161 |
|
|
| 162 |
|
throw new GovernorAssertionError($str); |
| 163 |
|
} |
| 164 |
|
|
| 165 |
|
/** |
| 166 |
|
* Report an error due to a an exception of an unexpected type. |