Tests reordering of displays.
public function testReorderDisplay() {
$view = array(
'block[create]' => TRUE,
);
$view = $this
->randomView($view);
$path_prefix = 'admin/structure/views/view/' . $view['id'] . '/edit';
$this
->clickLink(t('Reorder displays'));
$this
->assertTrue($this
->xpath('//tr[@id="display-row-default"]'), 'Make sure the default display appears on the reorder listing');
$this
->assertTrue($this
->xpath('//tr[@id="display-row-page_1"]'), 'Make sure the page display appears on the reorder listing');
$this
->assertTrue($this
->xpath('//tr[@id="display-row-block_1"]'), 'Make sure the block display appears on the reorder listing');
// Put the block display in front of the page display.
$edit = array(
'displays[page_1][weight]' => 2,
'displays[block_1][weight]' => 1,
);
$this
->drupalPost(NULL, $edit, t('Apply'));
$this
->drupalPost(NULL, array(), t('Save'));
$view = views_get_view($view['id']);
$displays = $view->storage
->get('display');
$this
->assertEqual($displays['default']['position'], 0, 'Make sure the master display comes first.');
$this
->assertEqual($displays['block_1']['position'], 1, 'Make sure the block display comes before the page display.');
$this
->assertEqual($displays['page_1']['position'], 2, 'Make sure the page display comes after the block display.');
}