| 1 | <?php |
||
| 11 | class ReturnExpectation implements ExpectationInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Regexp Expression matching return value |
||
| 15 | */ |
||
| 16 | private $regexp; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Set regular expression matching return value |
||
| 20 | * |
||
| 21 | * @param Regexp $regexp |
||
| 22 | */ |
||
| 23 | public function __construct(Regexp $regexp) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Validate that correct value is returned |
||
| 30 | * |
||
| 31 | * @param Result $result |
||
| 32 | * @return null |
||
| 33 | * @throws UnexpectedValueException If return value does not match regular expression |
||
| 34 | */ |
||
| 35 | public function validate(Result $result) |
||
| 45 | |||
| 46 | private function makeString($value) |
||
| 58 | } |
||
| 59 |