function UpdateRegistryTest::testDeprecatedConstructorSignature

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php \Drupal\Tests\Core\Update\UpdateRegistryTest::testDeprecatedConstructorSignature()

Tests the deprecated constructor signature.

Attributes

#[IgnoreDeprecations]

File

core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php, line 57

Class

UpdateRegistryTest
Tests UpdateRegistry.

Namespace

Drupal\Tests\Core\Update

Code

public function testDeprecatedConstructorSignature() : void {
  $container = new ContainerBuilder();
  $container->set('cache.memory', $this->memoryCache);
  \Drupal::setContainer($container);
  $theme_handler = $this->createStub(ThemeHandlerInterface::class);
  $theme_handler->method('listInfo')
    ->willReturn([]);
  $this->expectUserDeprecationMessage('Calling Drupal\\Core\\Update\\UpdateRegistry::__construct() without the $memoryCache argument is deprecated in drupal:11.5.0 and will be required in drupal:12.0.0. See https://www.drupal.org/node/3618917');
  new UpdateRegistry('vfs://drupal', 'sites/default', [], $this->createStub(KeyValueStoreInterface::class), $theme_handler, 'post_update');
}

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