From 03d3c27cb022ef37721839e11bfdce4b4a0965c8 Mon Sep 17 00:00:00 2001 From: webchick Date: Thu, 19 Mar 2015 00:14:45 -0700 Subject: [PATCH] Issue #2269033 by zaporylie, rpayanm, lieb, swentel, charginghawk, lorique, YesCT: ManageFieldsTest should not care about order of operations all the time --- .../field_ui/src/Tests/ManageFieldsTest.php | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index 1a42ce5905d..7c4cac016fe 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -151,11 +151,29 @@ class ManageFieldsTest extends WebTestBase { $this->assertLink('Add field'); // Assert entity operations for all fields. - $result = $this->xpath('//ul[@class = "dropbutton"]/li/a'); + $number_of_links = 3; + $number_of_links_found = 0; + $operation_links = $this->xpath('//ul[@class = "dropbutton"]/li/a'); $url = base_path() . "admin/structure/types/manage/$type/fields/node.$type.body"; - $this->assertIdentical($url, (string) $result[0]['href']); - $this->assertIdentical("$url/storage", (string) $result[1]['href']); - $this->assertIdentical("$url/delete", (string) $result[2]['href']); + + foreach ($operation_links as $link) { + switch ($link['title']) { + case 'Edit field settings.': + $this->assertIdentical($url, (string) $link['href']); + $number_of_links_found++; + break; + case 'Edit storage settings.': + $this->assertIdentical("$url/storage", (string) $link['href']); + $number_of_links_found++; + break; + case 'Delete field.': + $this->assertIdentical("$url/delete", (string) $link['href']); + $number_of_links_found++; + break; + } + } + + $this->assertEqual($number_of_links, $number_of_links_found); } /**