function TypedDataRelationshipPluginTest::testRelationshipName

Same name in other branches
  1. 8.x-3.x tests/src/Kernel/TypedDataRelationshipPluginTest.php \Drupal\Tests\ctools\Kernel\TypedDataRelationshipPluginTest::testRelationshipName()

@covers ::getName

File

tests/src/Kernel/TypedDataRelationshipPluginTest.php, line 16

Class

TypedDataRelationshipPluginTest
@coversDefaultClass \Drupal\ctools\Plugin\Relationship\TypedDataRelationship @group CTools

Namespace

Drupal\Tests\ctools\Kernel

Code

public function testRelationshipName() {
    
    /** @var \Drupal\ctools\Plugin\RelationshipInterface $nid_plugin */
    $nid_plugin = $this->relationshipManager
        ->createInstance('typed_data_relationship:entity:node:nid');
    $this->assertSame('nid', $nid_plugin->getName());
    
    /** @var \Drupal\ctools\Plugin\RelationshipInterface $uuid_plugin */
    $uuid_plugin = $this->relationshipManager
        ->createInstance('typed_data_relationship:entity:node:uuid');
    $this->assertSame('uuid', $uuid_plugin->getName());
    
    /** @var \Drupal\ctools\Plugin\RelationshipInterface $title_plugin */
    $title_plugin = $this->relationshipManager
        ->createInstance('typed_data_relationship:entity:node:title');
    $this->assertSame('title', $title_plugin->getName());
    
    /** @var \Drupal\ctools\Plugin\RelationshipInterface $body_plugin */
    $body_plugin = $this->relationshipManager
        ->createInstance('typed_data_relationship:entity:node:body');
    $this->assertSame('body', $body_plugin->getName());
    
    /** @var \Drupal\ctools\Plugin\RelationshipInterface $uid_plugin */
    $uid_plugin = $this->relationshipManager
        ->createInstance('typed_data_relationship:entity:node:uid');
    $this->assertSame('uid', $uid_plugin->getName());
    
    /** @var \Drupal\ctools\Plugin\RelationshipInterface $mail_plugin */
    $mail_plugin = $this->relationshipManager
        ->createInstance('typed_data_relationship:entity:user:mail');
    $this->assertSame('mail', $mail_plugin->getName());
}