diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php index 6c809e9..c3a9053 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyUnitTest.php @@ -120,19 +120,19 @@ function testTaxonomyVocabularyLoadMultiple() { $names = taxonomy_vocabulary_get_names(); $this->assertEqual($names[$vocabulary1->id()], $vocabulary1->id(), 'Vocabulary 1 name found.'); - // Fetch all of the vocabularies using taxonomy_vocabulary_load_multiple(). + // Fetch all vocabularies skipping a cache. // Confirm that the vocabularies are ordered by weight. - $vocabularies = taxonomy_vocabulary_load_multiple(); - $this->assertEqual(array_shift($vocabularies)->id(), $vocabulary1->id(), 'Vocabulary was found in the vocabularies array.'); - $this->assertEqual(array_shift($vocabularies)->id(), $vocabulary2->id(), 'Vocabulary was found in the vocabularies array.'); - $this->assertEqual(array_shift($vocabularies)->id(), $vocabulary3->id(), 'Vocabulary was found in the vocabularies array.'); + $vocabularies = $this->container->get('plugin.manager.entity')->getStorageController('taxonomy_vocabulary')->load(NULL, TRUE); + $loaded_order = array_keys($vocabularies); + $expected_order = array($vocabulary1->id(), $vocabulary2->id(), $vocabulary3->id()); + $this->assertIdentical($loaded_order, $expected_order); // Fetch the vocabularies with taxonomy_vocabulary_load_multiple(), specifying IDs. // Ensure they are returned in the same order as the original array. $vocabularies = taxonomy_vocabulary_load_multiple(array($vocabulary3->id(), $vocabulary2->id(), $vocabulary1->id())); - $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.'); + $loaded_order = array_keys($vocabularies); + $expected_order = array($vocabulary3->id(), $vocabulary2->id(), $vocabulary1->id()); + $this->assertIdentical($loaded_order, $expected_order); } /**