UpdateDescriptionTest.php in Drupal 10
File
core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php
View source
<?php
namespace Drupal\KernelTests\Core\Extension;
use Drupal\KernelTests\KernelTestBase;
class UpdateDescriptionTest extends KernelTestBase {
protected static $modules = [
'update_test_description',
];
public function testUpdateGetUpdateList() {
require_once $this->root . '/core/includes/update.inc';
\Drupal::service('update.update_hook_registry')
->setInstalledVersion('update_test_description', 8000);
\Drupal::moduleHandler()
->loadInclude('update_test_description', 'install');
$updates = update_get_update_list();
$expected = [
'pending' => [
8001 => '8001 - Update test of slash in description and/or.',
8002 => '8002 - Update test with multiline description, the quick brown fox jumped over the lazy dog.',
],
'start' => 8001,
];
$this
->assertEquals($expected, $updates['update_test_description']);
}
}