function StyleMappingTest::testMappedOutput
Verifies that the fields were mapped correctly.
File
- 
              core/
modules/ views/ tests/ src/ Kernel/ Plugin/ StyleMappingTest.php, line 32  
Class
- StyleMappingTest
 - Tests mapping style functionality.
 
Namespace
Drupal\Tests\views\Kernel\PluginCode
public function testMappedOutput() : void {
  $view = Views::getView('test_style_mapping');
  $output = (string) $this->mappedOutputHelper($view);
  $this->assertStringNotContainsString('job', $output, '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->assertStringContainsString('job', $output, 'The job field is added to the view and is in the mapping.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.