Commit 8cec5c8b authored by larowlan's avatar larowlan

Issue #2905720 by vaplas: Media specifies a add-page link relation, but...

Issue #2905720 by vaplas: Media specifies a add-page link relation, but core.link_relation_types does not have this
parent 6cbb5495
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
add-form: add-form:
uri: https://drupal.org/link-relations/add-form uri: https://drupal.org/link-relations/add-form
description: A form where a resource of this type can be created. description: A form where a resource of this type can be created.
add-page:
uri: https://drupal.org/link-relations/add-page
description: A page where a resource of this type and related types can be created.
delete-form: delete-form:
uri: https://drupal.org/link-relations/delete-form uri: https://drupal.org/link-relations/delete-form
description: A form where a resource of this type can be deleted. description: A form where a resource of this type can be deleted.
......
<?php
namespace Drupal\Tests\media\Kernel;
use Drupal\media\Entity\Media;
/**
* Tests link relationships for Media entity.
*
* @group media
*/
class MediaLinkRelationsTest extends MediaKernelTestBase {
/**
* Tests that all link relationships for Media exist.
*/
public function testExistLinkRelationships() {
/** @var \Drupal\Core\Http\LinkRelationTypeManager $link_relation_type_manager */
$link_relation_type_manager = $this->container->get('plugin.manager.link_relation_type');
$media = Media::create(['bundle' => $this->testMediaType->id()]);
$media->save();
foreach ($media->uriRelationships() as $relation_name) {
$this->assertTrue($link_relation_type_manager->hasDefinition($relation_name), "Link relationship '{$relation_name}' for Media entity");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment