PhpUnitBridgeIsolatedTest.php

Same filename in other branches
  1. 9 core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php
  2. 8.9.x core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php
  3. 11.x core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeIsolatedTest.php

Namespace

Drupal\Tests\Core\Test

File

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

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\Core\Test;

use Drupal\Tests\UnitTestCase;
use Drupal\deprecation_test\Deprecation\FixtureDeprecatedClass;

/**
 * Test how unit tests interact with deprecation errors in process isolation.
 *
 * @runTestsInSeparateProcesses
 * @preserveGlobalState disabled
 *
 * @group Test
 * @group legacy
 */
class PhpUnitBridgeIsolatedTest extends UnitTestCase {
    public function testDeprecatedClass() : void {
        $this->expectDeprecation('Drupal\\deprecation_test\\Deprecation\\FixtureDeprecatedClass is deprecated.');
        $deprecated = new FixtureDeprecatedClass();
        $this->assertEquals('test', $deprecated->testFunction());
    }

}

Classes

Title Deprecated Summary
PhpUnitBridgeIsolatedTest Test how unit tests interact with deprecation errors in process isolation.

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