| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function test() { |
||
| 18 | |||
| 19 | $raw = RawResponse::createDummyFrom( |
||
| 20 | 'HTTP/2 429 Too many requests' . "\r\n", |
||
| 21 | '{ |
||
| 22 | "type": "urn:ietf:params:acme:error:rateLimited", |
||
| 23 | "detail": "Service busy; retry later." |
||
| 24 | }', |
||
| 25 | ); |
||
| 26 | |||
| 27 | /** @var LE_ACME2\Exception\RateLimitReached $exception */ |
||
| 28 | $exception = $this->catchExpectedException(LE_ACME2\Exception\RateLimitReached::class, function() use($raw) { |
||
| 29 | new LE_ACME2\Response\GetDirectory($raw); |
||
| 30 | }); |
||
| 31 | $this->assertIsObject($exception); |
||
| 32 | $this->assertTrue(get_class($exception) == LE_ACME2\Exception\RateLimitReached::class); |
||
| 33 | } |
||
| 34 | } |