You are here

function UpdateCoreTest::testDatestampMismatch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/update/src/Tests/UpdateCoreTest.php \Drupal\update\Tests\UpdateCoreTest::testDatestampMismatch()

Ensures proper results where there are date mismatches among modules.

File

core/modules/update/src/Tests/UpdateCoreTest.php, line 175
Contains \Drupal\update\Tests\UpdateCoreTest.

Class

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

Namespace

Drupal\update\Tests

Code

function testDatestampMismatch() {
  $system_info = array(
    '#all' => array(
      // We need to think we're running a -dev snapshot to see dates.
      'version' => '8.0.0-dev',
      'datestamp' => time(),
    ),
    'block' => array(
      // This is 2001-09-09 01:46:40 GMT, so test for "2001-Sep-".
      'datestamp' => '1000000000',
    ),
  );
  $this
    ->config('update_test.settings')
    ->set('system_info', $system_info)
    ->save();
  $this
    ->refreshUpdateStatus(array(
    'drupal' => 'dev',
  ));
  $this
    ->assertNoText(t('2001-Sep-'));
  $this
    ->assertText(t('Up to date'));
  $this
    ->assertNoText(t('Update available'));
  $this
    ->assertNoText(t('Security update required!'));
}