assertCorrectContextualLinksInUi example

    $page = $this->getSession()->getPage();

    $this->drupalGet('node/1/layout');

    // Add a block that includes an entity contextual link.     $this->addBlock('Test Block View: Teaser block');

    // Add a block that includes a views contextual link.     $this->addBlock('Recent content');

    // Ensure the contextual links are correct before the layout is saved.     $this->assertCorrectContextualLinksInUi();

    // Ensure the contextual links are correct when the Layout Builder is loaded     // after being saved.     $page->hasButton('Save layout');
    $page->pressButton('Save layout');
    $this->drupalGet('node/1/layout');
    $this->assertCorrectContextualLinksInUi();

    $this->drupalGet('node/1');
    $this->assertCorrectContextualLinksInNode();
  }

  
Home | Imprint | This part of the site doesn't use cookies.