You are here

public function ViewsEscapingTest::testViewsViewFieldsEscaping in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/ViewsEscapingTest.php \Drupal\views\Tests\ViewsEscapingTest::testViewsViewFieldsEscaping()

Tests for incorrectly escaped markup in the views-view-fields.html.twig.

File

core/modules/views/src/Tests/ViewsEscapingTest.php, line 47
Contains \Drupal\views\Tests\ViewsEscapingTest.

Class

ViewsEscapingTest
Tests output of Views.

Namespace

Drupal\views\Tests

Code

public function testViewsViewFieldsEscaping() {

  // Test with system theme using theme function.
  $this
    ->drupalGet('test_page_display_200');

  // Assert that there are no escaped '<'s characters.
  $this
    ->assertNoEscaped('<');

  // Install theme to test with template system.
  \Drupal::service('theme_handler')
    ->install(array(
    'views_test_theme',
  ));

  // Make base theme default then test for hook invocations.
  $this
    ->config('system.theme')
    ->set('default', 'views_test_theme')
    ->save();
  $this
    ->assertEqual($this
    ->config('system.theme')
    ->get('default'), 'views_test_theme');
  $this
    ->drupalGet('test_page_display_200');

  // Assert that we are using the correct template.
  $this
    ->assertText('force', 'The force is strong with this one');

  // Assert that there are no escaped '<'s characters.
  $this
    ->assertNoEscaped('<');
}