MenuLinkReorderTest.php in Zircon Profile 8
File
core/modules/menu_ui/src/Tests/MenuLinkReorderTest.php
View source
<?php
namespace Drupal\menu_ui\Tests;
use Drupal\simpletest\WebTestBase;
class MenuLinkReorderTest extends WebTestBase {
protected $administrator;
public static $modules = array(
'menu_ui',
'test_page_test',
'node',
'block',
);
function testDefaultMenuLinkReorder() {
$this
->drupalPlaceBlock('system_menu_block:main');
$this
->drupalGet('test-page');
$this
->assertLink('Home');
$this->administrator = $this
->drupalCreateUser(array(
'administer site configuration',
'access administration pages',
'administer menu',
));
$this
->drupalLogin($this->administrator);
$edit = array(
'links[menu_plugin_id:test_page_test.front_page][weight]' => -10,
);
$this
->drupalPostForm('admin/structure/menu/manage/main', $edit, t('Save'));
$this
->drupalGet('test-page');
$this
->assertLink('Home');
$this
->drupalPostForm('admin/config/development/performance', [], t('Clear all caches'));
$this
->drupalGet('test-page');
$this
->assertLink('Home');
}
}