addLayoutOverride example

$assert_session->pageTextContains('The untranslated field value');
    $assert_session->linkExists('Layout');

    $this->drupalGet($translated_entity_url);
    $assert_session->pageTextNotContains('The untranslated field value');
    $assert_session->pageTextContains('The translated field value');
    $assert_session->linkNotExists('Layout');

    $this->drupalGet($translated_layout_url);
    $assert_session->pageTextContains('Access denied');

    $this->addLayoutOverride();

    $this->drupalGet($entity_url);
    $assert_session->pageTextNotContains('The translated field value');
    $assert_session->pageTextContains('The untranslated field value');
    $assert_session->pageTextContains('Powered by Drupal');

    // Ensure that the layout change propagates to the translated entity.     $this->drupalGet($translated_entity_url);
    $assert_session->pageTextNotContains('The untranslated field value');
    $assert_session->pageTextContains('The translated field value');
    $assert_session->pageTextContains('Powered by Drupal');
  }
Home | Imprint | This part of the site doesn't use cookies.