diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php index 1395014..7cc4b96 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php @@ -134,6 +134,19 @@ function testTaxonomyVocabularyLoadMultiple() { $this->assertEqual(array_shift($vocabularies)->id(), $vocabulary3->id(), 'Vocabulary loaded successfully by ID.'); $this->assertEqual(array_shift($vocabularies)->id(), $vocabulary2->id(), 'Vocabulary loaded successfully by ID.'); $this->assertEqual(array_shift($vocabularies)->id(), $vocabulary1->id(), 'Vocabulary loaded successfully by ID.'); + + // Test loading vocabularies by their properties. + $controller = $this->container->get('plugin.manager.entity')->getStorageController('taxonomy_vocabulary'); + // Fetch vocabulary 1 by name. + $vocabulary = current($controller->loadByProperties(array('name' => $vocabulary1->name))); + $this->assertEqual($vocabulary->id(), $vocabulary1->id(), 'Vocabulary loaded successfully by name.'); + + // Fetch vocabulary 2 by name and ID. + $vocabulary = current($controller->loadByProperties(array( + 'name' => $vocabulary2->name, + 'vid' => $vocabulary2->id(), + ))); + $this->assertEqual($vocabulary->id(), $vocabulary2->id(), 'Vocabulary loaded successfully by name and ID.'); } /**