assertNoHelpTexts example

->save();

    // Some of the expected texts.     $create_help = 'Create your media on the media add page (opens a new window), then add it by name to the field below.';
    $list_text = 'See the media list (opens a new window) to help locate media.';
    $use_help = 'Type part of the media name.';
    $create_header = "Create new media";
    $use_header = "Use existing media";

    // First check that none of the help texts are on the non-media content.     $this->drupalGet("/node/add/{$non_media_content_type->id()}");
    $this->assertNoHelpTexts([
      $create_header,
      $create_help,
      $use_header,
      $use_help,
      $list_text,
      'Allowed media types:',
    ]);

    // Now, check that the widget displays the expected help text under the     // given conditions for the test user.     $this->drupalLogin($test_user);
    
Home | Imprint | This part of the site doesn't use cookies.