public function LibraryDiscoveryParserTest::testBuildByExtensionWithTheme in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\LibraryDiscoveryParserTest::testBuildByExtensionWithTheme()
Tests that a theme can be used instead of a module.
@covers ::buildByExtension
File
- core/
tests/ Drupal/ Tests/ Core/ Asset/ LibraryDiscoveryParserTest.php, line 106 - Contains \Drupal\Tests\Core\Asset\LibraryDiscoveryParserTest.
Class
- LibraryDiscoveryParserTest
- @coversDefaultClass \Drupal\Core\Asset\LibraryDiscoveryParser @group Asset
Namespace
Drupal\Tests\Core\AssetCode
public function testBuildByExtensionWithTheme() {
$this->moduleHandler
->expects($this
->atLeastOnce())
->method('moduleExists')
->with('example_theme')
->will($this
->returnValue(FALSE));
$path = __DIR__ . '/library_test_files';
$path = substr($path, strlen($this->root) + 1);
$this->libraryDiscoveryParser
->setPaths('theme', 'example_theme', $path);
$libraries = $this->libraryDiscoveryParser
->buildByExtension('example_theme');
$library = $libraries['example'];
$this
->assertCount(0, $library['js']);
$this
->assertCount(1, $library['css']);
$this
->assertCount(0, $library['dependencies']);
$this
->assertEquals($path . '/css/example.css', $library['css'][0]['data']);
}