Commit 57b2e4f8 authored by alexpott's avatar alexpott
Browse files

Issue #2371841 by tim.plunkett | benjy: Fixed FullPageVariant::$mainContent...

Issue #2371841 by tim.plunkett | benjy: Fixed FullPageVariant::$mainContent must always be an array.
parent de568648
......@@ -51,7 +51,7 @@ class FullPageVariant extends VariantBase implements PageVariantInterface, Conta
*
* @var array
*/
protected $mainContent;
protected $mainContent = [];
/**
* Constructs a new FullPageVariant.
......
......@@ -156,4 +156,19 @@ public function testBuild(array $blocks_config, $visible_block_count, array $exp
$this->assertSame($expected_render_array, $display_variant->build());
}
/**
* Tests the building of a full page variant with no main content set.
*
* @covers ::build
*/
public function testBuildWithoutMainContent() {
$display_variant = $this->setUpDisplayVariant();
$this->blockRepository->expects($this->once())
->method('getVisibleBlocksPerRegion')
->willReturn([]);
$expected = ['content' => ['system_main' => []]];
$this->assertSame($expected, $display_variant->build());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment