function LegacyExtensionTest::testDeprecatedCall

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Extension/LegacyExtensionTest.php \Drupal\Tests\Core\Extension\LegacyExtensionTest::testDeprecatedCall()

@covers ::__call

File

core/tests/Drupal/Tests/Core/Extension/LegacyExtensionTest.php, line 20

Class

LegacyExtensionTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Extension%21Extension.php/class/Extension/11.x" title="Defines an extension (file) object." class="local">\Drupal\Core\Extension\Extension</a> @group Extension @group legacy

Namespace

Drupal\Tests\Core\Extension

Code

public function testDeprecatedCall() {
    $extension = new Extension($this->root, 'theme', 'core/themes/stark/stark.info.yml', 'stark.theme');
    $file = $extension->getFileInfo();
    $this->expectDeprecation('Drupal\\Core\\Extension\\Extension::__call(\'getCTime\') is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Extension\\Extension::getFileInfo() instead. See https://www.drupal.org/node/3322608');
    $this->assertSame($file->getCTime(), $extension->getCTime());
    $this->expectDeprecation('Drupal\\Core\\Extension\\Extension::__call(\'getMTime\') is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Extension\\Extension::getFileInfo() instead. See https://www.drupal.org/node/3322608');
    $this->assertSame($file->getMTime(), $extension->getMTime());
}

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