diff --git a/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php b/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php index d5f3ceed9a..486a043fbb 100644 --- a/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php +++ b/core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php @@ -6,14 +6,14 @@ use Drupal\KernelTests\KernelTestBase; /** - * Tests entity's label are in proper casing. + * Tests that entity type labels use sentence-case. * * @group Entity */ class EntityLabelTest extends KernelTestBase { /** - * Test to ensure that entity labels are in proper casing. + * Tests that entity type labels use sentence-case. */ public function testEntityLabelCasing() { $base_directory = $this->root . '/core/modules/'; @@ -36,8 +36,10 @@ public function testEntityLabelCasing() { $label_string = $label->getUntranslatedString(); $collection_label_string = $collection_label->getUntranslatedString(); - // Keep the first word as it is. Reason is we have special cases like - // RDF, URL alias etc. where we can't run strtolower() for entire string. + // Keep the first word as it is for nouns that are all capital letters + // (like RDF, URL alias etc.) so we can't run strtolower() for the entire + // string. Special cases may need to be added to this test in the future + // if an acronym is in a different position in the label. $first_word = strtok($label_string, " "); $remaining_string = strtolower(strstr($label_string, " ")); $this->assertEquals($first_word . $remaining_string, $label_string);