function BackwardsCompatibilityClassLoaderTest::testModuleMovedClass

Tests that a moved class from a module works.

@group legacy

File

core/tests/Drupal/KernelTests/Core/ClassLoader/BackwardsCompatibilityClassLoaderTest.php, line 38

Class

BackwardsCompatibilityClassLoaderTest
@coversDefaultClass Drupal\Core\ClassLoader\BackwardsCompatibilityClassLoader @group ClassLoader

Namespace

Drupal\KernelTests\Core\ClassLoader

Code

public function testModuleMovedClass() : void {
    // @phpstan-ignore class.notFound
    $this->expectDeprecation('Class ' . Foo::class . ' is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0, use Drupal\\Component\\Utility\\Random instead. See https://www.drupal.org/project/drupal/issues/3502882');
    // @phpstan-ignore class.notFound
    $object = new Foo();
    $this->assertInstanceOf(Random::class, $object);
}

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