setUpDisplayVariant example

->setConstructorArgs([$configuration, 'test', $definition])
      ->onlyMethods(['build'])
      ->getMock();
  }

  /** * Tests the label() method. * * @covers ::label */
  public function testLabel() {
    $display_variant = $this->setUpDisplayVariant(['label' => 'foo']);
    $this->assertSame('foo', $display_variant->label());
  }

  /** * Tests the label() method using a default value. * * @covers ::label */
  public function testLabelDefault() {
    $display_variant = $this->setUpDisplayVariant();
    $this->assertSame('', $display_variant->label());
  }
return $test_cases;
  }

  /** * Tests the building of a full page variant. * * @covers ::build * * @dataProvider providerBuild */
  public function testBuild(array $blocks_config$visible_block_count, array $expected_render_array) {
    $display_variant = $this->setUpDisplayVariant();
    $display_variant->setMainContent(['#markup' => 'Hello kittens!']);

    $blocks = ['top' => [], 'center' => [], 'bottom' => []];
    $block_plugin = $this->createMock('Drupal\Core\Block\BlockPluginInterface');
    $main_content_block_plugin = $this->createMock('Drupal\Core\Block\MainContentBlockPluginInterface');
    $messages_block_plugin = $this->createMock('Drupal\Core\Block\MessagesBlockPluginInterface');
    $title_block_plugin = $this->createMock('Drupal\Core\Block\TitleBlockPluginInterface');
    foreach ($blocks_config as $block_id => $block_config) {
      $block = $this->createMock('Drupal\block\BlockInterface');
      $block->expects($this->atLeastOnce())
        ->method('getPlugin')
        
Home | Imprint | This part of the site doesn't use cookies.