// The entire section for creating new media should only be displayed if
// the user can create at least one media of the type.
if ($create_media_types) { if (count($create_media_types) === 1
) { $url = Url::
fromRoute('entity.media.add_form'
)->
setRouteParameter('media_type',
$create_media_types[0
]);
} else { $url = Url::
fromRoute('entity.media.add_page'
);
} $this->
assertHelpTexts([$create_header,
$create_help],
$fieldset_selector);
$this->
assertHelpLink( $fieldset,
'media add page',
[ 'target' => '_blank',
'href' =>
$url->
toString(),
] );
} else { $this->
assertNoHelpTexts([$create_header,
$create_help]);
$this->
assertNoHelpLink($fieldset, 'media add page'
);
}