You are here

public function PanelizerEntityViewBuilderTest::testView in Panelizer 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/PanelizerEntityViewBuilderTest.php \Drupal\Tests\panelizer\Unit\PanelizerEntityViewBuilderTest::testView()
  2. 8.3 tests/src/Unit/PanelizerEntityViewBuilderTest.php \Drupal\Tests\panelizer\Unit\PanelizerEntityViewBuilderTest::testView()

Tests view().

@covers ::view

File

tests/src/Unit/PanelizerEntityViewBuilderTest.php, line 291

Class

PanelizerEntityViewBuilderTest
Tests the PanelizerEntityViewBuilder.

Namespace

Drupal\Tests\panelizer\Unit

Code

public function testView() {
  $data = $this
    ->setupView();
  $entities = $data['entities'];
  $expected = $data['expected'];
  $this->fallbackViewBuilder
    ->view($entities[234], 'full', 'pl')
    ->willReturn([
    '#markup' => 'Fallback',
  ]);
  $this
    ->assertEquals($expected[123], $this->entityViewBuilder
    ->view($entities[123], 'full', 'pl'));
  $this
    ->assertEquals($expected[234], $this->entityViewBuilder
    ->view($entities[234], 'full', 'pl'));
}