diff --git a/core/misc/drupal.js b/core/misc/drupal.js index 8813bc9..5199493 100644 --- a/core/misc/drupal.js +++ b/core/misc/drupal.js @@ -336,8 +336,9 @@ if (window.jQuery) { * Drupal.t() is called by this function, make sure not to pass * already-localized strings to it. * - * See the documentation of the server-side \Drupal::translation()->formatPlural() - * function for further details. + * See the documentation of the server-side + * \Drupal\Core\StringTranslation\TranslationInterface::formatPlural() + * function for more details. * * @param {Number} count * The item count to display. diff --git a/core/modules/search/src/Tests/SearchMultilingualEntityTest.php b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php index b1432dd..9035b4a 100644 --- a/core/modules/search/src/Tests/SearchMultilingualEntityTest.php +++ b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php @@ -278,8 +278,9 @@ protected function assertIndexCounts($remaining, $total, $message) { $this->assertEqual($status['total'], $total, 'Total items ' . $message . ' is ' . $total); // Check text in progress section of Search settings page. Note that this - // test avoids using \Drupal::translation()->formatPlural(), so it tests for - // fragments of text. + // test avoids using + // \Drupal\Core\StringTranslation\TranslationInterface::formatPlural(), so + // it tests for fragments of text. $indexed = $total - $remaining; $percent = ($total > 0) ? floor(100 * $indexed / $total) : 100; $this->drupalGet('admin/config/search/pages'); diff --git a/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php b/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php index 7946baf..b925285 100644 --- a/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php +++ b/core/modules/system/src/Tests/Extension/InfoParserUnitTest.php @@ -67,6 +67,17 @@ public function testInfoParser() { $this->assertEqual($e->getMessage(), $expected_message); } + // Tests that a single missing required key is detected. + $filename = 'core/modules/system/tests/fixtures/missing_key.info.txt'; + try { + $this->infoParser->parse($filename); + $this->fail('Expected InfoParserException not thrown when reading missing_key.info.txt'); + } + catch (InfoParserException $e) { + $expected_message = "Missing required key (type) in $filename."; + $this->assertEqual($e->getMessage(), $expected_message); + } + $info_values = $this->infoParser->parse('core/modules/system/tests/fixtures/common_test.info.txt'); $this->assertEqual($info_values['simple_string'], 'A simple string', 'Simple string value was parsed correctly.', 'System'); $this->assertEqual($info_values['version'], \Drupal::VERSION, 'Constant value was parsed correctly.', 'System'); diff --git a/core/modules/system/tests/fixtures/missing_key.info.txt b/core/modules/system/tests/fixtures/missing_key.info.txt new file mode 100644 index 0000000..022b5f3 --- /dev/null +++ b/core/modules/system/tests/fixtures/missing_key.info.txt @@ -0,0 +1,8 @@ +# info.yml for testing missing type key. +name: File +description: 'Defines a file field type.' +package: Core +version: VERSION +core: 8.x +dependencies: + - field