You are here

public function PageTest::testAddContext in Page Manager 8

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

@covers ::addContext

File

tests/src/Unit/PageTest.php, line 176
Contains \Drupal\Tests\page_manager\Unit\PageTest.

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);
}