public function ComponentsInfoTest::testGetAllThemeInfo in Components! 8.2
Tests retrieving all components info from themes.
@covers ::getAllThemeInfo
File
- tests/
src/ Unit/ ComponentsInfoTest.php, line 391
Class
- ComponentsInfoTest
- @coversDefaultClass \Drupal\components\Template\ComponentsInfo @group components
Namespace
Drupal\Tests\components\UnitCode
public function testGetAllThemeInfo() {
$this->moduleExtensionList
->method('getAllInstalledInfo')
->willReturn([]);
$this->themeExtensionList
->expects($this
->exactly(1))
->method('getAllInstalledInfo')
->willReturn([
'foo' => [
'name' => 'Foo',
'type' => 'theme',
'no-components' => 'ignored',
],
'bar' => [
'name' => 'Bar',
'type' => 'theme',
'components' => [
'included' => 'not-ignored',
],
],
]);
$this->themeExtensionList
->expects($this
->exactly(2))
->method('getPath')
->willReturn($this->themesDir . '/foo', $this->themesDir . '/bar');
$this
->newSystemUnderTest();
$expected = [
'bar' => [
'included' => 'not-ignored',
'extensionPath' => $this->themesDir . '/bar',
],
];
$result = $this->systemUnderTest
->getAllThemeInfo();
$this
->assertEquals($expected, $result);
}