You are here

protected function PanelsStorageTest::setUp in Panels 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Unit/PanelsStorageTest.php \Drupal\Tests\panels\Unit\PanelsStorageTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/PanelsStorageTest.php, line 53

Class

PanelsStorageTest
Tests the PageManagerPanelsStorage service.

Namespace

Drupal\Tests\panels\Unit

Code

protected function setUp() {
  parent::setUp();
  $this->panelsDisplay = $this
    ->prophesize(PanelsDisplayVariant::class);
  $this->pageVariant = $this
    ->prophesize(PageVariantInterface::class);
  $this->pageVariant
    ->getVariantPlugin()
    ->willReturn($this->panelsDisplay
    ->reveal());
  $this->pageVariantNotPanels = $this
    ->prophesize(PageVariantInterface::class);
  $this->pageVariantNotPanels
    ->getContexts()
    ->shouldNotBeCalled();
  $non_panels_variant = $this
    ->prophesize(HttpStatusCodeDisplayVariant::class);
  $this->pageVariantNotPanels
    ->getVariantPlugin()
    ->willReturn($non_panels_variant
    ->reveal());
  $this->storage = $this
    ->prophesize(EntityStorageInterface::class);
  $this->entityTypeManager = $this
    ->prophesize(EntityTypeManagerInterface::class);
  $this->entityTypeManager
    ->getStorage('page_variant')
    ->willReturn($this->storage
    ->reveal());
}