You are here

public function ThemeEngineExtensionListTest::testGetlist in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php \Drupal\KernelTests\Core\Extension\ThemeEngineExtensionListTest::testGetlist()

@covers ::getList

File

core/tests/Drupal/KernelTests/Core/Extension/ThemeEngineExtensionListTest.php, line 17

Class

ThemeEngineExtensionListTest
@coversDefaultClass \Drupal\Core\Extension\ThemeEngineExtensionList @group Extension

Namespace

Drupal\KernelTests\Core\Extension

Code

public function testGetlist() {
  $settings = Settings::getAll();
  $settings['install_profile'] = 'testing';
  new Settings($settings);

  // Confirm that all theme engines are available.
  $theme_engines = \Drupal::service('extension.list.theme_engine')
    ->getList();
  $this
    ->assertArrayHasKey('twig', $theme_engines);
  $this
    ->assertArrayHasKey('nyan_cat', $theme_engines);
  $this
    ->assertCount(2, $theme_engines);
}