You are here

public function ContextMapperTest::testGetContextValuesEntityContext in Page Manager 8.4

Same name and namespace in other branches
  1. 8 tests/src/Unit/ContextMapperTest.php \Drupal\Tests\page_manager\Unit\ContextMapperTest::testGetContextValuesEntityContext()

@covers ::getContextValues

File

tests/src/Unit/ContextMapperTest.php, line 89

Class

ContextMapperTest
@coversDefaultClass \Drupal\page_manager\ContextMapper

Namespace

Drupal\Tests\page_manager\Unit

Code

public function testGetContextValuesEntityContext() {
  $input = [
    'foo' => [
      'label' => 'Foo',
      'type' => 'entity:node',
      'value' => 'the_node_uuid',
    ],
  ];
  $expected = new EntityLazyLoadContext(ContextDefinitionFactory::create('entity:node')
    ->setLabel('Foo'), $this->entityRepository
    ->reveal(), 'the_node_uuid');
  $actual = $this->staticContext
    ->getContextValues($input)['foo'];
  $this
    ->assertEquals($expected, $actual);
}