EventsExampleServiceTest.php

Same filename in other branches
  1. 4.0.x modules/events_example/tests/src/Kernel/EventsExampleServiceTest.php

Namespace

Drupal\Tests\events_example\Kernel

File

modules/events_example/tests/src/Kernel/EventsExampleServiceTest.php

View source
<?php

namespace Drupal\Tests\events_example\Kernel;

use Drupal\KernelTests\KernelTestBase;
use Drupal\events_example\EventSubscriber\EventsExampleSubscriber;

/**
 * Test to ensure 'events_example_subscriber' service is reachable.
 *
 * @group events_example
 * @group examples
 *
 * @ingroup events_example
 */
class EventsExampleServiceTest extends KernelTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'events_example',
    ];
    
    /**
     * Test for existence of 'events_example_subscriber' service.
     */
    public function testEventsExampleService() {
        $subscriber = $this->container
            ->get('events_example_subscriber');
        $this->assertInstanceOf(EventsExampleSubscriber::class, $subscriber);
    }

}

Classes

Title Deprecated Summary
EventsExampleServiceTest Test to ensure 'events_example_subscriber' service is reachable.