core/lib/Drupal/Core/Asset/LibraryDiscovery.php | 4 ++-- .../Core/Asset/LibraryDiscoveryInterface.php | 20 +++++++++--------- .../Tests/Core/Asset/LibraryDiscoveryTest.php | 22 ++++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php index 9025788..d53f630 100644 --- a/core/lib/Drupal/Core/Asset/LibraryDiscovery.php +++ b/core/lib/Drupal/Core/Asset/LibraryDiscovery.php @@ -16,12 +16,12 @@ /** - * Discovers available libraries in drupal. + * Discovers available libraries in Drupal. */ class LibraryDiscovery implements LibraryDiscoveryInterface { /** - * Stores the library information keyed by extension + * Stores the library information keyed by extension. * * @var array */ diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php index da4dc50..402b7d3 100644 --- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php +++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php @@ -8,16 +8,16 @@ namespace Drupal\Core\Asset; /** - * Discovers information for javascript/CSS libraries. + * Discovers information for CSS/JavaScript libraries. * - * Library information is statically cached. Libraries are keyed by module for - * several reasons: - * - Libraries are not unique. Multiple modules might ship with the same library - * in a different version or variant. This registry cannot (and does not - * attempt to) prevent library conflicts. - * - Modules implementing and thereby depending on a library that is registered - * by another module can only rely on that module's library. - * - Two (or more) modules can still register the same library and use it + * Library information is statically cached. Libraries are keyed by extension + * for several reasons: + * - Libraries are not unique. Multiple extensions might ship with the same + * library in a different version or variant. This registry cannot (and does + * not attempt to) prevent library conflicts. + * - Extensions implementing and thereby depending on a library that is + * registered by another extension can only rely on that extension's library. + * - Two (or more) extensions can still register the same library and use it * without conflicts in case the libraries are loaded on certain pages only. */ interface LibraryDiscoveryInterface { @@ -32,7 +32,7 @@ * An associative array of libraries registered by $extension is returned * (which may be empty). * - * @see self::getLibraryByName + * @see self::getLibraryByName() */ public function getLibrariesByExtension($extension); diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php index a13fc1b..cc67cfc 100644 --- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php @@ -85,7 +85,7 @@ protected function setUp() { } /** - * Ensures that basic functionality works for getLibraryByName. + * Tests that basic functionality works for getLibraryByName. * * @covers ::getLibraryByName() */ @@ -110,7 +110,7 @@ public function testGetLibraryByNameSimple() { } /** - * Ensures that basic functionality works for getLibrariesByExtension. + * Tests that basic functionality works for getLibrariesByExtension. * * @covers ::getLibrariesByExtension() */ @@ -130,7 +130,7 @@ public function testGetLibrariesByExtensionSimple() { } /** - * Ensures that a theme can be used instead of a module. + * Tests that a theme can be used instead of a module. */ public function testGetLibraryByNameWithTheme() { $this->moduleHandler->expects($this->atLeastOnce()) @@ -150,7 +150,7 @@ public function testGetLibraryByNameWithTheme() { } /** - * Ensures that a module with a missing library file results in an empty lib. + * Tests that a module with a missing library file results in FALSE. */ public function testGetLibraryWithMissingLibraryFile() { $this->moduleHandler->expects($this->atLeastOnce()) @@ -167,7 +167,7 @@ public function testGetLibraryWithMissingLibraryFile() { } /** - * Ensures that an exception is thrown when a file could not be parsed. + * Tests that an exception is thrown when a libraries file couldn't be parsed. * * @expectedException \RuntimeException */ @@ -185,7 +185,7 @@ public function testInvalidLibrariesFile() { } /** - * Ensures that an exception is thrown when no css/js/setting is specified. + * Tests that an exception is thrown when no CSS/JS/setting is specified. * * @expectedException \RuntimeException * @expectedExceptionMessage Incomplete library definition for 'example' in core/tests/Drupal/Tests/Core/Asset/library_test_files/example_module_missing_information.libraries.yml @@ -204,7 +204,7 @@ public function testGetLibraryWithMissingInformation() { } /** - * Ensures that version of external libraries gets handled. + * Tests that the version property of external libraries is handled. */ public function testExternalLibraries() { $this->moduleHandler->expects($this->atLeastOnce()) @@ -222,7 +222,7 @@ public function testExternalLibraries() { } /** - * Ensures that CSS weights is taken into account properly. + * Ensures that CSS weights are taken into account properly. */ public function testDefaultCssWeights() { $this->moduleHandler->expects($this->atLeastOnce()) @@ -257,7 +257,7 @@ public function testDefaultCssWeights() { } /** - * Ensures that you cannot provide positive weights for css libraries. + * Ensures that you cannot provide positive weights for JavaScript libraries. * * @expectedException \UnexpectedValueException */ @@ -275,7 +275,7 @@ public function testJsWithPositiveWeight() { } /** - * Tests a library with CSS/JS and a setting. + * Tests a library with CSS/JavaScript and a setting. */ public function testLibraryWithCssJsSetting() { $this->moduleHandler->expects($this->atLeastOnce()) @@ -289,7 +289,7 @@ public function testLibraryWithCssJsSetting() { $library = $this->libraryDiscovery->getLibraryByName('css_js_settings', 'example'); - // Ensures that the group and type is set automatically. + // Ensures that the group and type are set automatically. $this->assertEquals(-100, $library['js'][0]['group']); $this->assertEquals('file', $library['js'][0]['type']); $this->assertEquals($path . '/js/example.js', $library['js'][0]['data']);