You are here

protected function KernelTest::getKernel in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Tests/KernelTest.php \Symfony\Component\HttpKernel\Tests\KernelTest::getKernel()

Returns a mock for the abstract kernel.

Parameters

array $methods Additional methods to mock (besides the abstract ones):

array $bundles Bundles to register:

Return value

Kernel

27 calls to KernelTest::getKernel()
KernelTest::getKernelMockForIsClassInActiveBundleTest in vendor/symfony/http-kernel/Tests/KernelTest.php
KernelTest::testBootInitializesBundlesAndContainer in vendor/symfony/http-kernel/Tests/KernelTest.php
KernelTest::testBootKernelSeveralTimesOnlyInitializesBundlesOnce in vendor/symfony/http-kernel/Tests/KernelTest.php
KernelTest::testBootSetsTheContainerToTheBundles in vendor/symfony/http-kernel/Tests/KernelTest.php
KernelTest::testClassCacheIsLoaded in vendor/symfony/http-kernel/Tests/KernelTest.php

... See full list

File

vendor/symfony/http-kernel/Tests/KernelTest.php, line 816

Class

KernelTest

Namespace

Symfony\Component\HttpKernel\Tests

Code

protected function getKernel(array $methods = array(), array $bundles = array()) {
  $methods[] = 'registerBundles';
  $kernel = $this
    ->getMockBuilder('Symfony\\Component\\HttpKernel\\Kernel')
    ->setMethods($methods)
    ->setConstructorArgs(array(
    'test',
    false,
  ))
    ->getMockForAbstractClass();
  $kernel
    ->expects($this
    ->any())
    ->method('registerBundles')
    ->will($this
    ->returnValue($bundles));
  $p = new \ReflectionProperty($kernel, 'rootDir');
  $p
    ->setAccessible(true);
  $p
    ->setValue($kernel, __DIR__ . '/Fixtures');
  return $kernel;
}