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