You are here

public function UpdateSemverCoreTest::testModulePageUpToDate in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php \Drupal\Tests\update\Functional\UpdateSemverCoreTest::testModulePageUpToDate()

Checks the messages at admin/modules when the site is up to date.

File

core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php, line 336

Class

UpdateSemverCoreTest
Tests the Update Manager module through a series of functional tests using mock XML data.

Namespace

Drupal\Tests\update\Functional

Code

public function testModulePageUpToDate() {
  $this
    ->setProjectInstalledVersion('8.0.0');

  // Instead of using refreshUpdateStatus(), set these manually.
  $this
    ->config('update.settings')
    ->set('fetch.url', Url::fromRoute('update_test.update_test')
    ->setAbsolute()
    ->toString())
    ->save();
  $this
    ->config('update_test.settings')
    ->set('xml_map', [
    'drupal' => '0.0',
  ])
    ->save();
  $this
    ->drupalGet('admin/reports/updates');
  $this
    ->clickLink('Check manually');
  $this
    ->checkForMetaRefresh();
  $this
    ->assertSession()
    ->pageTextContains('Checked available update data for one project.');
  $this
    ->drupalGet('admin/modules');
  $this
    ->assertSession()
    ->pageTextNotContains('There are updates available for your version of Drupal.');
  $this
    ->assertSession()
    ->pageTextNotContains('There is a security update available for your version of Drupal.');
}