function UpdateUploadTest::testUpdateManagerCoreSecurityUpdateMessages

Same name in other branches
  1. 8.9.x core/modules/update/tests/src/Functional/UpdateUploadTest.php \Drupal\Tests\update\Functional\UpdateUploadTest::testUpdateManagerCoreSecurityUpdateMessages()
  2. 10 core/modules/update/tests/src/Functional/UpdateUploadTest.php \Drupal\Tests\update\Functional\UpdateUploadTest::testUpdateManagerCoreSecurityUpdateMessages()
  3. 11.x core/modules/update/tests/src/Functional/UpdateUploadTest.php \Drupal\Tests\update\Functional\UpdateUploadTest::testUpdateManagerCoreSecurityUpdateMessages()

Checks the messages on update manager pages when missing a security update.

File

core/modules/update/tests/src/Functional/UpdateUploadTest.php, line 166

Class

UpdateUploadTest
Tests the Update Manager module's upload and extraction functionality.

Namespace

Drupal\Tests\update\Functional

Code

public function testUpdateManagerCoreSecurityUpdateMessages() {
    $setting = [
        '#all' => [
            'version' => '8.0.0',
        ],
    ];
    $this->config('update_test.settings')
        ->set('system_info', $setting)
        ->set('xml_map', [
        'drupal' => '0.2-sec',
    ])
        ->save();
    $this->config('update.settings')
        ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()
        ->toString())
        ->save();
    // Initialize the update status.
    $this->drupalGet('admin/reports/updates');
    // Now, make sure none of the Update manager pages have duplicate messages
    // about core missing a security update.
    $this->drupalGet('admin/modules/install');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
    $this->drupalGet('admin/modules/update');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
    $this->drupalGet('admin/appearance/install');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
    $this->drupalGet('admin/appearance/update');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
    $this->drupalGet('admin/reports/updates/install');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
    $this->drupalGet('admin/reports/updates/update');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
    $this->drupalGet('admin/update/ready');
    $this->assertSession()
        ->pageTextNotContains('There is a security update available for your version of Drupal.');
}

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