'administer node fields',
'administer node display',
'administer node form display',
'view the administration theme',
]));
$this->
drupalGet('admin/structure/types/manage/article/display'
);
// Verify that the order of view modes is alphabetical by visible label.
// Since the default view modes all have machine names which coincide with
// the English labels, they should appear in alphabetical order, by default
// if viewing the site in English and if no changes have been made. We will
// verify this first.
$page_text =
$this->
getTextContent();
$start =
strpos($page_text, 'view modes'
);
$pos =
$start;
$list =
['Full content', 'RSS', 'Search index', 'Search result', 'Teaser'
];
// Verify that the order of the view modes is correct on the page.
foreach ($list as $name) { $new_pos =
strpos($page_text,
$name,
$start);
$this->
assertGreaterThan($pos,
$new_pos);
$pos =
$new_pos;
} // Now that we have verified the original display order, we can change the
// label for one of the view modes. If we rename "Teaser" to "Breezer", it