public function PageVariantTest::testGetContexts in Page Manager 8
Same name and namespace in other branches
- 8.4 tests/src/Unit/PageVariantTest.php \Drupal\Tests\page_manager\Unit\PageVariantTest::testGetContexts()
@covers ::getContexts @dataProvider providerTestGetContexts
File
- tests/
src/ Unit/ PageVariantTest.php, line 67 - Contains \Drupal\Tests\page_manager\Unit\PageVariantTest.
Class
- PageVariantTest
- @coversDefaultClass \Drupal\page_manager\Entity\PageVariant
Namespace
Drupal\Tests\page_manager\UnitCode
public function testGetContexts($static_contexts, $page_contexts, $expected) {
$this->contextMapper
->getContextValues([])
->willReturn($static_contexts)
->shouldBeCalledTimes(1);
$this->page
->getContexts()
->willReturn($page_contexts)
->shouldBeCalledTimes(1);
$contexts = $this->pageVariant
->getContexts();
$this
->assertSame($expected, $contexts);
$contexts = $this->pageVariant
->getContexts();
$this
->assertSame($expected, $contexts);
}