| @@ 115-128 (lines=14) @@ | ||
| 112 | * @param mixed $responseData |
|
| 113 | * @param string $error |
|
| 114 | */ |
|
| 115 | private function checkException($requestData, $responseData, $error) |
|
| 116 | { |
|
| 117 | try { |
|
| 118 | $request = $this->getRequestMock($requestData); |
|
| 119 | $method = new CreateReservation(function () use ($responseData) { |
|
| 120 | return $responseData; |
|
| 121 | }); |
|
| 122 | $method->call($request); |
|
| 123 | $this->fail('Expected exception to be thrown'); |
|
| 124 | ||
| 125 | } catch (MethodException $e) { |
|
| 126 | $this->assertContains($error, $e->getMessage()); |
|
| 127 | } |
|
| 128 | } |
|
| 129 | ||
| 130 | } |
|
| 131 | ||
| @@ 152-165 (lines=14) @@ | ||
| 149 | * @param array $responseData |
|
| 150 | * @param string $error |
|
| 151 | */ |
|
| 152 | private function checkException(array $requestData, array $responseData, $error) |
|
| 153 | { |
|
| 154 | try { |
|
| 155 | $request = $this->getRequestMock($requestData); |
|
| 156 | $method = new GetSlots(function () use ($responseData) { |
|
| 157 | return $responseData; |
|
| 158 | }); |
|
| 159 | $method->call($request); |
|
| 160 | $this->fail(sprintf('Expected exception with "%s" to be thrown', $error)); |
|
| 161 | ||
| 162 | } catch (MethodException $e) { |
|
| 163 | $this->assertContains($error, $e->getMessage()); |
|
| 164 | } |
|
| 165 | } |
|
| 166 | ||
| 167 | } |
|
| 168 | ||