You are here

public function ContactFieldsTest::testViewsData in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/contact/src/Tests/Views/ContactFieldsTest.php \Drupal\contact\Tests\Views\ContactFieldsTest::testViewsData()

Tests the views data generation.

File

core/modules/contact/src/Tests/Views/ContactFieldsTest.php, line 59
Contains \Drupal\contact\Tests\Views\ContactFieldsTest.

Class

ContactFieldsTest
Tests which checks that no fieldapi fields are added on contact.

Namespace

Drupal\contact\Tests\Views

Code

public function testViewsData() {

  // Test that the field is not exposed to views, since contact_message
  // entities have no storage.
  $table_name = 'contact_message__' . $this->fieldStorage
    ->getName();
  $data = $this->container
    ->get('views.views_data')
    ->get($table_name);
  $this
    ->assertFalse($data, 'The field is not exposed to Views.');
}