You are here

public function RelationshipManagerTest::testRelationshipPluginAvailability in Chaos Tool Suite (ctools) 8.3

@covers ::getDefinitionsForContexts

File

tests/src/Kernel/RelationshipManagerTest.php, line 40

Class

RelationshipManagerTest
@coversDefaultClass \Drupal\ctools\Plugin\RelationshipManager @group CTools

Namespace

Drupal\Tests\ctools\Kernel

Code

public function testRelationshipPluginAvailability() {
  $context_definition = new EntityContextDefinition('entity:node');
  $contexts = [
    'node' => new Context($context_definition, $this->entities['node1']),
  ];
  $definitions = $this->relationshipManager
    ->getDefinitionsForContexts($contexts);

  // $this->assertTrue(isset($definitions['typed_data_relationship:entity:node:body']));
  $context_definition = new EntityContextDefinition('entity:node');
  $contexts = [
    'node' => new Context($context_definition, $this->entities['node2']),
  ];
  $definitions = $this->relationshipManager
    ->getDefinitionsForContexts($contexts);
  $this
    ->assertFalse(isset($definitions['typed_data_relationship:entity:node:body']));
  $context_definition = new EntityContextDefinition('entity:node');
  $contexts = [
    'node' => new Context($context_definition, $this->entities['node3']),
  ];
  $definitions = $this->relationshipManager
    ->getDefinitionsForContexts($contexts);

  // $this->assertTrue(isset($definitions['typed_data_relationship:entity:node:body']));
}