You are here

public function Fast404EventSubscriberTest::testOnNotFoundException in Fast 404 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/Fast404EventSubscriberTest.php \Drupal\Tests\fast404\Unit\Fast404EventSubscriberTest::testOnNotFoundException()

Tests event handling for not found exceptions.

@covers ::onNotFoundException

File

tests/src/Unit/Fast404EventSubscriberTest.php, line 49

Class

Fast404EventSubscriberTest
Tests the fast404 event subscriber logic.

Namespace

Drupal\Tests\fast404\Unit

Code

public function testOnNotFoundException() {
  $subscriber = $this
    ->getFast404EventSubscriber();
  $subscriber
    ->onNotFoundException($this->event);
  $e = $this->event
    ->getException();
  $this
    ->assertTrue($e instanceof NotFoundHttpException);
}