function UpdateTestTrait::mockDefaultExtensionsInfo

Same name and namespace in other branches
  1. 10 core/modules/update/tests/src/Functional/UpdateTestTrait.php \Drupal\Tests\update\Functional\UpdateTestTrait::mockDefaultExtensionsInfo()

Sets default information about installed extensions.

Parameters

string[] $default_info: The *.info.yml key-value pairs to be mocked across all extensions. Hence, these can be seen as default/fallback values.

12 calls to UpdateTestTrait::mockDefaultExtensionsInfo()
UpdateContribTest::testCoreCompatibilityMessage in core/modules/update/tests/src/Functional/UpdateContribTest.php
Tests that core compatibility messages are displayed.
UpdateContribTest::testHookUpdateStatusAlter in core/modules/update/tests/src/Functional/UpdateContribTest.php
Checks that hook_update_status_alter() works to change a status.
UpdateContribTest::testNoReleasesAvailable in core/modules/update/tests/src/Functional/UpdateContribTest.php
Tests when there is no available release data for a contrib module.
UpdateContribTest::testSecurityUpdateAvailability in core/modules/update/tests/src/Functional/UpdateContribTest.php
Tests update status of security releases.
UpdateContribTest::testUpdateBrokenFetchURL in core/modules/update/tests/src/Functional/UpdateContribTest.php
Makes sure that if we fetch from a broken URL, sane things happen.

... See full list

File

core/modules/update/tests/src/Functional/UpdateTestTrait.php, line 55

Class

UpdateTestTrait
Provides a trait to set system info and XML mappings.

Namespace

Drupal\Tests\update\Functional

Code

protected function mockDefaultExtensionsInfo(array $default_info) : void {
    $system_info = $this->config('update_test.settings')
        ->get('system_info');
    $system_info = [
        '#all' => $default_info,
    ] + $system_info;
    $this->config('update_test.settings')
        ->set('system_info', $system_info)
        ->save();
}

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