public function KernelTest::testHandleBootsTheKernel

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/KernelTest.php, line 236

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

public function testHandleBootsTheKernel() {
  $type = HttpKernelInterface::MASTER_REQUEST;
  $catch = true;
  $request = new Request();
  $httpKernelMock = $this
    ->getMockBuilder('Symfony\\Component\\HttpKernel\\HttpKernel')
    ->disableOriginalConstructor()
    ->getMock();
  $kernel = $this
    ->getMockBuilder('Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\KernelForTest')
    ->disableOriginalConstructor()
    ->setMethods(array(
    'getHttpKernel',
    'boot',
  ))
    ->getMock();
  $kernel
    ->expects($this
    ->once())
    ->method('getHttpKernel')
    ->will($this
    ->returnValue($httpKernelMock));
  $kernel
    ->expects($this
    ->once())
    ->method('boot');

  // required as this value is initialized
  // in the kernel constructor, which we don't call
  $kernel
    ->setIsBooted(false);
  $kernel
    ->handle($request, $type, $catch);
}