You are here

public function PageTest::testAddContext in Page Manager 8.4

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

@covers ::addContext

File

tests/src/Unit/PageTest.php, line 171

Class

PageTest
Tests the Page entity.

Namespace

Drupal\Tests\page_manager\Unit

Code

public function testAddContext() {
  $context = new Context(new ContextDefinition('bar'));
  $this->page
    ->addContext('foo', $context);
  $contexts = $this->page
    ->getContexts();
  $this
    ->assertSame([
    'foo' => $context,
  ], $contexts);
}