You are here

public function StyleMappingTest::testMappedOutput in Views (for Drupal 7) 8.3

Verifies that the fields were mapped correctly.

File

lib/Drupal/views/Tests/Plugin/StyleMappingTest.php, line 33
Definition of Drupal\views\Tests\Plugin\StyleMappingTest.

Class

StyleMappingTest
Tests the default/mapping row style.

Namespace

Drupal\views\Tests\Plugin

Code

public function testMappedOutput() {
  $view = $this
    ->getView();
  $output = $this
    ->mappedOutputHelper($view);
  $this
    ->assertTrue(strpos($output, 'job') === FALSE, 'The job field is added to the view but not in the mapping.');
  $view = $this
    ->getView();
  $view->displayHandlers['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.');
}