KernelTestBaseTest.php

Same filename in this branch
  1. 8.9.x core/modules/simpletest/src/Tests/KernelTestBaseTest.php
  2. 8.9.x core/tests/Drupal/KernelTests/KernelTestBaseTest.php
Same filename and directory in other branches
  1. 11.x core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php
  2. 11.x core/tests/Drupal/KernelTests/KernelTestBaseTest.php
  3. 10 core/modules/pgsql/tests/src/Kernel/pgsql/KernelTestBaseTest.php
  4. 10 core/tests/Drupal/KernelTests/KernelTestBaseTest.php
  5. 9 core/tests/Drupal/KernelTests/KernelTestBaseTest.php

Namespace

Drupal\Tests\Core\Test

File

core/tests/Drupal/Tests/Core/Test/KernelTestBaseTest.php

View source
<?php

namespace Drupal\Tests\Core\Test;

use Drupal\Tests\UnitTestCase;
use Drupal\KernelTests\KernelTestBase;

/**
 * @group Test
 * @group legacy
 *
 * @coversDefaultClass \Drupal\KernelTests\KernelTestBase
 */
class KernelTestBaseTest extends UnitTestCase {
  
  /**
   * @expectedDeprecation Drupal\KernelTests\KernelTestBase::isTestInIsolation() is deprecated in Drupal 8.4.x, for removal before the Drupal 9.0.0 release. KernelTestBase tests are always run in isolated processes.
   *
   * @covers ::isTestInIsolation
   */
  public function testDeprecatedIsTestInIsolation() {
    $kernel_test = $this->getMockBuilder(KernelTestBase::class)
      ->disableOriginalConstructor()
      ->getMockForAbstractClass();
    $is_isolated = new \ReflectionMethod($kernel_test, 'isTestInIsolation');
    $is_isolated->setAccessible(TRUE);
    // Assert that the return value is a bool, because this unit test might or
    // might not be running in process isolation.
    $this->assertInternalType('bool', $is_isolated->invoke($kernel_test));
  }

}

Classes

Title Deprecated Summary
KernelTestBaseTest @group Test @group legacy

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