Mercurial > hg > cmmr2012-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\media\Kernel; | |
4 | |
5 use Drupal\media\Entity\Media; | |
6 | |
7 /** | |
8 * Tests link relationships for media items. | |
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 a media item"); | |
24 } | |
25 } | |
26 | |
27 } |