You are here

public function MissingProjectInfoTest::testMissingProjectInfo in Automatic Updates 8

Tests pending db updates readiness checks.

File

tests/src/Kernel/ReadinessChecker/MissingProjectInfoTest.php, line 34

Class

MissingProjectInfoTest
Tests missing project info readiness checking.

Namespace

Drupal\Tests\automatic_updates\Kernel\ReadinessChecker

Code

public function testMissingProjectInfo() {

  // The checker should always have messages on the testbot, since project
  // info is added by the packager.
  $ignore_paths = "modules/custom/*\nthemes/custom/*\nprofiles/custom/*";
  $this
    ->config('automatic_updates.settings')
    ->set('ignored_paths', $ignore_paths)
    ->save();
  $messages = $this->container
    ->get('automatic_updates.missing_project_info')
    ->run();
  $this
    ->assertNotEmpty($messages);

  // Now test with a some dummy info data that won't cause any issues.
  $extension_list = $this
    ->createMock(ExtensionList::class);
  $messages = (new TestMissingProjectInfo($extension_list, $extension_list, $extension_list))
    ->run();
  $this
    ->assertEmpty($messages);
}