class UpdateDescriptionTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php \Drupal\KernelTests\Core\Extension\UpdateDescriptionTest
- 10 core/tests/Drupal/KernelTests/Core/Extension/UpdateDescriptionTest.php \Drupal\KernelTests\Core\Extension\UpdateDescriptionTest
Tests for update descriptions.
@group Core
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Extension\UpdateDescriptionTest implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of UpdateDescriptionTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ UpdateDescriptionTest.php, line 12
Namespace
Drupal\KernelTests\Core\ExtensionView source
class UpdateDescriptionTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'update_test_description',
];
/**
* Tests the list of pending database updates.
*
* @see update_get_update_list()
*/
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']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.