FeedExceptionTest.php 517 B

1234567891011121314
  1. <?php
  2. declare(strict_types=1);
  3. final class FeedExceptionTest extends \PHPUnit\Framework\TestCase {
  4. public function test_keepsHttpStatusCode(): void {
  5. $previous = new RuntimeException('previous');
  6. $e = new FreshRSS_Feed_Exception('Gone', 410, $previous);
  7. self::assertSame(410, $e->getCode()); // feedController mutes a feed on HTTP 410 Gone
  8. self::assertSame('Gone', $e->getMessage());
  9. self::assertSame($previous, $e->getPrevious());
  10. self::assertSame(0, (new FreshRSS_Feed_Exception())->getCode());
  11. }
  12. }