You are here

public function HooksTest::testModulesInstalled in Lightning Core 8.5

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/HooksTest.php \Drupal\Tests\lightning_core\Kernel\HooksTest::testModulesInstalled()
  2. 8.4 tests/src/Kernel/HooksTest.php \Drupal\Tests\lightning_core\Kernel\HooksTest::testModulesInstalled()

File

tests/src/Kernel/HooksTest.php, line 19

Class

HooksTest
@group lightning_core

Namespace

Drupal\Tests\lightning_core\Kernel

Code

public function testModulesInstalled() {
  $update_manager = $this
    ->prophesize(UpdateManager::class);
  $update_manager
    ->getVersion(Argument::any())
    ->willReturn('1.0.0');
  $this->container
    ->set('lightning.update_manager', $update_manager
    ->reveal());
  lightning_core_modules_installed([
    'foo',
    'bar',
  ]);

  // The stored versions should be sorted by key.
  $expected_versions = [
    'bar' => '1.0.0',
    'foo' => '1.0.0',
  ];
  $this
    ->assertSame($expected_versions, $this
    ->config('lightning_core.versions')
    ->get());
}