function DrupalKernelLegacyTest::testKernelEventDeprecation

Tests deprecation message in overridden KernelEvent.

@covers ::isMasterRequest

File

core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelLegacyTest.php, line 21

Class

DrupalKernelLegacyTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21DrupalKernel.php/class/DrupalKernel/9" title="The DrupalKernel class is the core of Drupal itself." class="local">\Drupal\Core\DrupalKernel</a> @group legacy

Namespace

Drupal\Tests\Core\DrupalKernel

Code

public function testKernelEventDeprecation() {
    $kernel = $this->createMock(DrupalKernel::class);
    $request = $this->createMock(Request::class);
    $event = new KernelEvent($kernel, $request, $kernel::MASTER_REQUEST);
    $this->expectDeprecation('Symfony\\Component\\HttpKernel\\Event\\KernelEvent::isMasterRequest() is deprecated, use isMainRequest()');
    $this->assertTrue($event->isMasterRequest());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.