public function StyleMappingTest::testMappedOutput

Verifies that the fields were mapped correctly.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleMappingTest.php, line 39
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 = views_get_view('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['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.');
}