comparison core/modules/media/tests/src/Kernel/MediaLinkRelationsTest.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }