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 \Drupal\Core\DrupalKernel @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.