You are here

public function StyleMappingTest::testMappedOutput in Zircon Profile 8

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

Verifies that the fields were mapped correctly.

File

core/modules/views/src/Tests/Plugin/StyleMappingTest.php, line 31
Contains \Drupal\views\Tests\Plugin\StyleMappingTest.

Class

StyleMappingTest
Tests mapping style functionality.

Namespace

Drupal\views\Tests\Plugin

Code

public function testMappedOutput() {
  $view = Views::getView('test_style_mapping');
  $output = $this
    ->mappedOutputHelper($view);
  $this
    ->assertTrue(strpos($output, 'job') === FALSE, 'The job field is added to the view but not in the mapping.');
  $view
    ->destroy();
  $view
    ->setDisplay();
  $view->displayHandlers
    ->get('default')->options['style']['options']['mapping']['name_field'] = 'job';
  $output = $this
    ->mappedOutputHelper($view);
  $this
    ->assertTrue(strpos($output, 'job') !== FALSE, 'The job field is added to the view and is in the mapping.');
}