diff --git a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php index eef2d95178d7f6c3f65549fe7b4f3187f2667c75..5d36dd270fee792969af82f16685744ea5de5ff2 100644 --- a/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php +++ b/core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php @@ -197,11 +197,8 @@ public function updateFeedItems(FeedInterface $feed, $expected_count = NULL) { $this->clickLink('Update items'); // Ensure we have the right number of items. - $iids = \Drupal::entityQuery('aggregator_item')->condition('fid', $feed->id())->execute(); - $feed->items = []; - foreach ($iids as $iid) { - $feed->items[] = $iid; - } + $item_ids = \Drupal::entityQuery('aggregator_item')->condition('fid', $feed->id())->execute(); + $feed->items = array_values($item_ids); if ($expected_count !== NULL) { $feed->item_count = count($feed->items); diff --git a/core/modules/aggregator/tests/src/Functional/FeedParserTest.php b/core/modules/aggregator/tests/src/Functional/FeedParserTest.php index 95be9e5171fa4f3c408435c3a30bad46428a768f..7ff11b8b8c031a23236a24b9496e58a38370d641 100644 --- a/core/modules/aggregator/tests/src/Functional/FeedParserTest.php +++ b/core/modules/aggregator/tests/src/Functional/FeedParserTest.php @@ -64,16 +64,16 @@ public function testAtomSample() { $this->assertText('Atom-Powered Robots Run Amok'); $this->assertLinkByHref('http://example.org/2003/12/13/atom03'); $this->assertText('Some text.'); - $iids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/13/atom03')->execute(); - $item = Item::load(array_values($iids)[0]); + $item_ids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/13/atom03')->execute(); + $item = Item::load(array_values($item_ids)[0]); $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', $item->getGuid(), 'Atom entry id element is parsed correctly.'); // Check for second feed entry. $this->assertText('We tried to stop them, but we failed.'); $this->assertLinkByHref('http://example.org/2003/12/14/atom03'); $this->assertText('Some other text.'); - $iids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/14/atom03')->execute(); - $item = Item::load(array_values($iids)[0]); + $item_ids = \Drupal::entityQuery('aggregator_item')->condition('link', 'http://example.org/2003/12/14/atom03')->execute(); + $item = Item::load(array_values($item_ids)[0]); $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-bbbb-80da344efa6a', $item->getGuid(), 'Atom entry id element is parsed correctly.'); } diff --git a/core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php b/core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php index fdbcc04eabd4d6ca8abd4d2d8bebf4b4314d7165..4c5a3d3ab3cbaeeb070d732ed28270761648f3ff 100644 --- a/core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php +++ b/core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php @@ -54,8 +54,8 @@ public function testUpdateFeedItem() { $feed = Feed::load(array_values($fids)[0]); $feed->refreshItems(); - $iids = \Drupal::entityQuery('aggregator_item')->condition('fid', $feed->id())->execute(); - $before = Item::load(array_values($iids)[0])->getPostedTime(); + $item_ids = \Drupal::entityQuery('aggregator_item')->condition('fid', $feed->id())->execute(); + $before = Item::load(array_values($item_ids)[0])->getPostedTime(); // Sleep for 3 second. sleep(3); @@ -67,7 +67,7 @@ public function testUpdateFeedItem() { ->save(); $feed->refreshItems(); - $after = Item::load(array_values($iids)[0])->getPostedTime(); + $after = Item::load(array_values($item_ids)[0])->getPostedTime(); $this->assertTrue($before === $after, new FormattableMarkup('Publish timestamp of feed item was not updated (@before === @after)', ['@before' => $before, '@after' => $after])); // Make sure updating items works even after uninstalling a module diff --git a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php index 2f0693af233631193367278e2edc2b0ddffe305d..fd878e7eaa29e549c3c2fbc943594cd055c13283 100644 --- a/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php +++ b/core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php @@ -241,9 +241,9 @@ public function providerTestBuildCacheability() { ]; // Multi-level tree. - $multi_level_root_a = MenuLinkMock::create(['id' => 'test.roota', 'route_name' => 'roota', 'title' => 'Root A']); - $multi_level_root_b = MenuLinkMock::create(['id' => 'test.rootb', 'route_name' => 'rootb', 'title' => 'Root B']); - $multi_level_parent_c = MenuLinkMock::create(['id' => 'test.parentc', 'route_name' => 'parentc', 'title' => 'Parent C']); + $multi_level_root_a = MenuLinkMock::create(['id' => 'test.root_a', 'route_name' => 'root_a', 'title' => 'Root A']); + $multi_level_root_b = MenuLinkMock::create(['id' => 'test.root_b', 'route_name' => 'root_b', 'title' => 'Root B']); + $multi_level_parent_c = MenuLinkMock::create(['id' => 'test.parent_c', 'route_name' => 'parent_c', 'title' => 'Parent C']); $tree = [ new MenuLinkTreeElement($multi_level_root_a, TRUE, 0, FALSE, [ new MenuLinkTreeElement($multi_level_parent_c, TRUE, 0, FALSE, [ @@ -256,13 +256,13 @@ public function providerTestBuildCacheability() { ]; $tree[0]->subtree[0]->subtree[0]->access = $access; $expected_build = $base_expected_build; - $expected_build['#items']['test.roota'] = $get_built_element($tree[0]); - $expected_build['#items']['test.roota']['below']['test.parentc'] = $get_built_element($tree[0]->subtree[0]); + $expected_build['#items']['test.root_a'] = $get_built_element($tree[0]); + $expected_build['#items']['test.root_a']['below']['test.parent_c'] = $get_built_element($tree[0]->subtree[0]); if ($access === NULL || $access->isAllowed()) { - $expected_build['#items']['test.roota']['below']['test.parentc']['below']['test.example1'] = $get_built_element($tree[0]->subtree[0]->subtree[0]); + $expected_build['#items']['test.root_a']['below']['test.parent_c']['below']['test.example1'] = $get_built_element($tree[0]->subtree[0]->subtree[0]); } - $expected_build['#items']['test.rootb'] = $get_built_element($tree[1]); - $expected_build['#items']['test.rootb']['below']['test.example2'] = $get_built_element($tree[1]->subtree[0]); + $expected_build['#items']['test.root_b'] = $get_built_element($tree[1]); + $expected_build['#items']['test.root_b']['below']['test.example2'] = $get_built_element($tree[1]->subtree[0]); $expected_build['#cache']['contexts'] = array_merge($expected_build['#cache']['contexts'], $access_cache_contexts, $links[0]->getCacheContexts(), $links[1]->getCacheContexts()); $data[] = [ 'description' => "Multi-level tree; access=$i; link=$j.", diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php index 0b32d35c8e7ad63d75eaa978227ec9a245080f6e..b6ca2ff04c187855f2f912fe18283e561b9ffe83 100644 --- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php +++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php @@ -343,16 +343,16 @@ public function testSorting() { ->getTypePlugin() ->setConfiguration([ 'states' => [ - 'twoa' => [ - 'label' => 'twoa', + 'two_a' => [ + 'label' => 'two a', 'weight' => 2, ], 'three' => [ 'label' => 'three', 'weight' => 3, ], - 'twob' => [ - 'label' => 'twob', + 'two_b' => [ + 'label' => 'two b', 'weight' => 2, ], 'one' => [ @@ -367,10 +367,10 @@ public function testSorting() { 'to' => 'three', 'weight' => 3, ], - 'twoa' => [ - 'label' => 'twoa', - 'from' => ['twoa'], - 'to' => 'twoa', + 'two_a' => [ + 'label' => 'two a', + 'from' => ['two_a'], + 'to' => 'two_a', 'weight' => 2, ], 'one' => [ @@ -379,10 +379,10 @@ public function testSorting() { 'to' => 'one', 'weight' => 1, ], - 'twob' => [ - 'label' => 'twob', - 'from' => ['twob'], - 'to' => 'twob', + 'two_b' => [ + 'label' => 'two b', + 'from' => ['two_b'], + 'to' => 'two_b', 'weight' => 2, ], ], @@ -391,12 +391,12 @@ public function testSorting() { $this->drupalLogin($this->createUser(['administer workflows'])); $this->drupalGet('admin/config/workflow/workflows/manage/test'); - $expected_states = ['one', 'twoa', 'twob', 'three']; + $expected_states = ['one', 'two a', 'two b', 'three']; $elements = $this->xpath('//details[@id="edit-states-container"]//table/tbody/tr'); foreach ($elements as $key => $element) { $this->assertEquals($expected_states[$key], $element->find('xpath', 'td')->getText()); } - $expected_transitions = ['one', 'twoa', 'twob', 'three']; + $expected_transitions = ['one', 'two a', 'two b', 'three']; $elements = $this->xpath('//details[@id="edit-transitions-container"]//table/tbody/tr'); foreach ($elements as $key => $element) { $this->assertEquals($expected_transitions[$key], $element->find('xpath', 'td')->getText());