function LibraryDiscoveryParserTest::testBuildByExtensionWithTheme
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\LibraryDiscoveryParserTest::testBuildByExtensionWithTheme()
- 10 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\LibraryDiscoveryParserTest::testBuildByExtensionWithTheme()
- 11.x 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 127
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']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.