removeWhiteSpace example


  public function testRenderChildren() {
    // Ensure that #prefix and #suffix is only being printed once since that is     // the behavior the caller code expects.     $build = [
      '#type' => 'container',
      '#theme' => 'theme_test_render_element_children',
      '#prefix' => 'kangaroo',
      '#suffix' => 'kitten',
    ];
    $this->render($build);
    $this->removeWhiteSpace();
    $this->assertNoRaw('<div>kangarookitten</div>');
  }

  /** * Tests that we get an exception when we try to attach an illegal type. */
  public function testProcessAttached() {
    // Specify invalid attachments in a render array.     $build['#attached']['library'][] = 'core/drupal.states';
    $build['#attached']['drupal_process_states'][] = [];
    $renderer = $this->container->get('bare_html_page_renderer');
    
'#type' => 'table',
      '#header' => $header,
      '#rows' => [],
      '#empty' => 'Empty row.',
    ];

    // Enable the Starterkit theme.     \Drupal::service('theme_installer')->install(['starterkit_theme']);
    $this->config('system.theme')->set('default', 'starterkit_theme')->save();

    $this->render($table);
    $this->removeWhiteSpace();
    $this->assertRaw('<thead><tr><th>Header 1</th><th colspan="2">Header 2</th></tr>', 'Table header found.');
    $this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">Empty row.</td>', 'Colspan on #empty row found.');
  }

  /** * Tests that the 'no_striping' option works correctly. */
  public function testThemeTableWithNoStriping() {
    $rows = [
      [
        'data' => [1],
        
Home | Imprint | This part of the site doesn't use cookies.