diff --git a/core/includes/update.inc b/core/includes/update.inc index 9fc38226245b135614946d1187280fe655cb5a35..4643666bdd2a1b6e7d272281ec902e6bbad4f19f 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -14,8 +14,15 @@ /** * Tests the compatibility of a module or theme. + * + * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. No direct + * replacement is provided. + * + * @see https://www.drupal.org/node/3150727 + * @see \Drupal\Core\Extension\ExtensionList::checkIncompatibility() */ function update_check_incompatibility($name, $type = 'module') { + @trigger_error('update_check_incompatibility() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3150727', E_USER_DEPRECATED); static $themes, $modules; // Store values of expensive functions for future use. diff --git a/core/tests/Drupal/KernelTests/Core/Extension/UpdateDeprecationTest.php b/core/tests/Drupal/KernelTests/Core/Extension/UpdateDeprecationTest.php new file mode 100644 index 0000000000000000000000000000000000000000..e51e35e05fe0871ff9d530334dec7a1027bf5a44 --- /dev/null +++ b/core/tests/Drupal/KernelTests/Core/Extension/UpdateDeprecationTest.php @@ -0,0 +1,35 @@ +<?php + +namespace Drupal\KernelTests\Core\Extension; + +use Drupal\KernelTests\KernelTestBase; + +/** + * Tests deprecated update.inc functions. + * + * @group legacy + * @group extension + */ +class UpdateDeprecationTest extends KernelTestBase { + + /** + * {@inheritdoc} + */ + protected function setUp(): void { + parent::setUp(); + + // Include the legacy update.inc file. + include_once $this->root . '/core/includes/update.inc'; + } + + /** + * Tests update_check_incompatibility() function. + * + * @expectedDeprecation update_check_incompatibility() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3150727 + */ + public function testUpdateCheckIncompatibility() { + $this->assertTrue(update_check_incompatibility('incompatible_module')); + $this->assertFalse(update_check_incompatibility('system')); + } + +}