Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / media / tests / src / Kernel / MediaLinkRelationsTest.php
1 <?php
2
3 namespace Drupal\Tests\media\Kernel;
4
5 use Drupal\media\Entity\Media;
6
7 /**
8  * Tests link relationships for Media entity.
9  *
10  * @group media
11  */
12 class MediaLinkRelationsTest extends MediaKernelTestBase {
13
14   /**
15    * Tests that all link relationships for Media exist.
16    */
17   public function testExistLinkRelationships() {
18     /** @var \Drupal\Core\Http\LinkRelationTypeManager $link_relation_type_manager */
19     $link_relation_type_manager = $this->container->get('plugin.manager.link_relation_type');
20     $media = Media::create(['bundle' => $this->testMediaType->id()]);
21     $media->save();
22     foreach ($media->uriRelationships() as $relation_name) {
23       $this->assertTrue($link_relation_type_manager->hasDefinition($relation_name), "Link relationship '{$relation_name}' for Media entity");
24     }
25   }
26
27 }