You are here

public function ContextMapperTest::testGetContextValuesEntityContext in Page Manager 8

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

@covers ::getContextValues

File

tests/src/Unit/ContextMapperTest.php, line 94
Contains \Drupal\Tests\page_manager\Unit\ContextMapperTest.

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(new ContextDefinition('entity:node', 'Foo'), $this->entityRepository
    ->reveal(), 'the_node_uuid');
  $actual = $this->staticContext
    ->getContextValues($input)['foo'];
  $this
    ->assertEquals($expected, $actual);
}