public function KernelTest::testHandleCallsHandleOnHttpKernel

File

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

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

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