class DependencyHookInvocationTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest
- 10 core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest
- 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/DependencyHookInvocationTest.php \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest
Tests the hook invocation for determining update dependencies.
@group Update
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\UpdateSystem\DependencyHookInvocationTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of DependencyHookInvocationTest
File
-
core/
modules/ system/ tests/ src/ Functional/ UpdateSystem/ DependencyHookInvocationTest.php, line 12
Namespace
Drupal\Tests\system\Functional\UpdateSystemView source
class DependencyHookInvocationTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'update_test_0',
'update_test_1',
'update_test_2',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
require_once $this->root . '/core/includes/update.inc';
}
/**
* Tests the structure of the array returned by hook_update_dependencies().
*/
public function testHookUpdateDependencies() {
$update_dependencies = update_retrieve_dependencies();
$this->assertSame(8001, $update_dependencies['update_test_0'][8001]['update_test_1'], 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.');
$this->assertSame(8002, $update_dependencies['update_test_0'][8001]['update_test_2'], 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.');
$this->assertSame(8003, $update_dependencies['update_test_0'][8002]['update_test_1'], 'An update function that depends on more than one update from the same module only has the dependency on the higher-numbered update function recorded.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.