You are here

public function MenuAdminPerMenuNodeFormTest::testEntityOperationsAccess in Menu Admin per Menu 8

Test that entity operations are not added to other entities than menus.

File

tests/src/Functional/MenuAdminPerMenuNodeFormTest.php, line 229

Class

MenuAdminPerMenuNodeFormTest
Tests the interaction of the node system with menu links.

Namespace

Drupal\Tests\menu_admin_per_menu\Functional

Code

public function testEntityOperationsAccess() {
  $this
    ->drupalLogin($this->rootUser);

  // Make sure the entity operation is only added to menus.
  $node = $this
    ->drupalCreateNode([
    'type' => 'menu_test',
  ]);
  $this
    ->drupalGet('/admin/content');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->linkByHrefNotExists(sprintf('/admin/structure/menu/manage/%s', $node
    ->id()));
  $this
    ->assertSession()
    ->linkByHrefNotExists(sprintf('/admin/structure/menu/manage/%s/add', $node
    ->id()));
}