Mercurial > hg > cmmr2012-drupal-site
diff core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php Thu Jul 05 14:24:15 2018 +0000 @@ -0,0 +1,27 @@ +<?php + +namespace Drupal\Tests\media\Kernel; + +use Drupal\media\Entity\Media; + +/** + * Tests link relationships for media items. + * + * @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 a media item"); + } + } + +}