You are here

public function AutomaticUpdatesTest::testReadinessChecks in Automatic Updates 8

Tests manually running readiness checks.

File

tests/src/Functional/AutomaticUpdatesTest.php, line 97

Class

AutomaticUpdatesTest
Tests of automatic updates.

Namespace

Drupal\Tests\automatic_updates\Functional

Code

public function testReadinessChecks() {
  $ignore_paths = "modules/custom/*\nthemes/custom/*\nprofiles/custom/*";
  $this
    ->config('automatic_updates.settings')
    ->set('ignored_paths', $ignore_paths)
    ->save();

  // Test manually running readiness checks. A few warnings will occur.
  $this
    ->drupalGet(Url::fromRoute('automatic_updates.settings'));
  $this
    ->clickLink('run the readiness checks');
  $this
    ->assertSession()
    ->pageTextContains('Your site does not pass some readiness checks for automatic updates. Depending on the nature of the failures, it might effect the eligibility for automatic updates.');

  // Ignore specific file paths to see no readiness issues.
  $ignore_paths = "vendor/*\ncore/*\nmodules/*\nthemes/*\nprofiles/*\ncomposer.*\nautoload.php\nLICENSE.txt";
  $this
    ->config('automatic_updates.settings')
    ->set('ignored_paths', $ignore_paths)
    ->save();
  $this
    ->drupalGet(Url::fromRoute('automatic_updates.settings'));
  $this
    ->clickLink('run the readiness checks');
  $this
    ->assertSession()
    ->pageTextContains('No issues found. Your site is ready for automatic updates.');
}