Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / ctools / tests / src / Kernel / TypedDataLanguageRelationshipPluginTest.php
1 <?php
2
3 namespace Drupal\Tests\ctools\Kernel;
4
5 use Drupal\Core\Language\LanguageInterface;
6
7 /**
8  * @coversDefaultClass \Drupal\ctools\Plugin\Relationship\TypedDataEntityRelationship
9  * @group CTools
10  */
11 class TypedDataLanguageRelationshipPluginTest extends RelationshipsTestBase {
12
13   /**
14    * @covers ::getName
15    */
16   public function testRelationshipName() {
17     /** @var \Drupal\ctools\Plugin\RelationshipInterface $langcode_plugin */
18     $langcode_plugin = $this->relationshipManager->createInstance('typed_data_language_relationship:entity:node:langcode');
19     $this->assertSame('langcode', $langcode_plugin->getName());
20   }
21
22   /**
23    * @covers ::getRelationship
24    *
25    * @todo expand to include a new language.
26    */
27   public function testRelationship() {
28     /** @var \Drupal\ctools\Plugin\RelationshipInterface $langcode_plugin */
29     $langcode_plugin = $this->relationshipManager->createInstance('typed_data_language_relationship:entity:node:langcode');
30     $langcode_plugin->setContextValue('base', $this->entities['node1']);
31     $relationship = $langcode_plugin->getRelationship();
32     $this->assertTrue($relationship->getContextValue() instanceof LanguageInterface);
33     $this->assertSame('en', $relationship->getContextValue()->getId());
34   }
35
36 }