function UpdateSemverCoreTest::testDatestampMismatch

Same name in other branches
  1. 9 core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php \Drupal\Tests\update\Functional\UpdateSemverCoreTest::testDatestampMismatch()
  2. 10 core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php \Drupal\Tests\update\Functional\UpdateSemverCoreTest::testDatestampMismatch()

Ensures proper results where there are date mismatches among modules.

File

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

Class

UpdateSemverCoreTest
Tests edge cases of the Available Updates report UI.

Namespace

Drupal\Tests\update\Functional

Code

public function testDatestampMismatch() : void {
    $this->mockInstalledExtensionsInfo([
        'block' => [
            // This is 2001-09-09 01:46:40 GMT, so test for "2001-Sep-".
'datestamp' => '1000000000',
        ],
    ]);
    // We need to think we're running a -dev snapshot to see dates.
    $this->mockDefaultExtensionsInfo([
        'version' => '8.1.0-dev',
        'datestamp' => time(),
    ]);
    $this->refreshUpdateStatus([
        'drupal' => 'dev',
    ]);
    $this->assertSession()
        ->pageTextNotContains('2001-Sep-');
    $this->assertSession()
        ->pageTextContains('Up to date');
    $this->assertSession()
        ->pageTextNotContains('Update available');
    $this->assertSession()
        ->pageTextNotContains('Security update required!');
}

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