You are here

public function EventsExampleServiceTest::testEventsExampleService in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 events_example/tests/src/Kernel/EventsExampleServiceTest.php \Drupal\Tests\events_example\Kernel\EventsExampleServiceTest::testEventsExampleService()

Test for existence of 'events_example_subscriber' service.

File

modules/events_example/tests/src/Kernel/EventsExampleServiceTest.php, line 26

Class

EventsExampleServiceTest
Test to ensure 'events_example_subscriber' service is reachable.

Namespace

Drupal\Tests\events_example\Kernel

Code

public function testEventsExampleService() {
  $subscriber = $this->container
    ->get('events_example_subscriber');
  $this
    ->assertInstanceOf(EventsExampleSubscriber::class, $subscriber);
}