Aucune description

ServiceUnavailableHttpExceptionTest.php 811B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Symfony\Component\HttpKernel\Tests\Exception;
  3. use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
  4. class ServiceUnavailableHttpExceptionTest extends HttpExceptionTest
  5. {
  6. public function testHeadersDefaultRetryAfter()
  7. {
  8. $exception = new ServiceUnavailableHttpException(10);
  9. $this->assertSame(array('Retry-After' => 10), $exception->getHeaders());
  10. }
  11. /**
  12. * @dataProvider headerDataProvider
  13. */
  14. public function testHeadersSetter($headers)
  15. {
  16. $exception = new ServiceUnavailableHttpException(10);
  17. $exception->setHeaders($headers);
  18. $this->assertSame($headers, $exception->getHeaders());
  19. }
  20. protected function createException()
  21. {
  22. return new ServiceUnavailableHttpException();
  23. }
  24. }