You are here

protected function FieldInstancePerViewModeTest::setUp in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/field/tests/src/Unit/Plugin/migrate/source/d6/FieldInstancePerViewModeTest.php \Drupal\Tests\field\Unit\Plugin\migrate\source\d6\FieldInstancePerViewModeTest::setUp()
  2. 8 core/modules/field/tests/src/Unit/Plugin/migrate/source/d7/FieldInstancePerViewModeTest.php \Drupal\Tests\field\Unit\Plugin\migrate\source\d7\FieldInstancePerViewModeTest::setUp()
Same name and namespace in other branches
  1. 8.0 core/modules/field/tests/src/Unit/Plugin/migrate/source/d6/FieldInstancePerViewModeTest.php \Drupal\Tests\field\Unit\Plugin\migrate\source\d6\FieldInstancePerViewModeTest::setUp()

Overrides MigrateSqlSourceTestCase::setUp

File

core/modules/field/tests/src/Unit/Plugin/migrate/source/d6/FieldInstancePerViewModeTest.php, line 78
Contains \Drupal\Tests\field\Unit\Plugin\migrate\source\d6\FieldInstancePerViewModeTest.

Class

FieldInstancePerViewModeTest
Tests D6 fields per view mode source plugin.

Namespace

Drupal\Tests\field\Unit\Plugin\migrate\source\d6

Code

protected function setUp() {
  foreach ($this->expectedResults as $k => $field_view_mode) {

    // These are stored as serialized strings.
    $field_view_mode['display_settings'] = serialize($field_view_mode['display_settings']);
    $field_view_mode['widget_settings'] = serialize($field_view_mode['widget_settings']);
    $this->databaseContents['content_node_field'][] = array(
      'field_name' => $field_view_mode['field_name'],
      'type' => $field_view_mode['type'],
      'module' => $field_view_mode['module'],
    );
    unset($field_view_mode['type']);
    unset($field_view_mode['module']);
    $this->databaseContents['content_node_field_instance'][] = $field_view_mode;

    // Update the expected display settings.
    $this->expectedResults[$k]['display_settings'] = $this->expectedResults[$k]['display_settings'][$field_view_mode['view_mode']];
  }
  parent::setUp();
}