$container->
set('cache_contexts_manager',
$cache_context_manager);
$cache_context_manager->
expects($this->
any()) ->
method('assertValidTokens'
) ->
willReturn(TRUE
);
\Drupal::
setContainer($container);
$this->blockRepository =
$this->
createMock('Drupal\block\BlockRepositoryInterface'
);
$this->blockViewBuilder =
$this->
createMock('Drupal\Core\Entity\EntityViewBuilderInterface'
);
return $this->
getMockBuilder('Drupal\block\Plugin\DisplayVariant\BlockPageVariant'
) ->
setConstructorArgs([$configuration, 'test',
$definition,
$this->blockRepository,
$this->blockViewBuilder,
['config:block_list'
]]) ->
addMethods(['getRegionNames'
]) ->
getMock();
} public function providerBuild() { $blocks_config =
[ 'block1' =>
[ // region, is main content block, is messages block, is title block
'top', FALSE, FALSE, FALSE,
],
// Test multiple blocks in the same region.
'block2' =>
[