3 namespace Drupal\Tests\views\Functional\Update;
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6 use Drupal\views\Entity\View;
9 * Tests the upgrade path for views field handlers.
11 * @see views_post_update_cleanup_duplicate_views_data()
16 class FieldHandlersUpdateTest extends UpdatePathTestBase {
21 protected function setDatabaseDumpFiles() {
22 $this->databaseDumpFiles = [
23 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
24 __DIR__ . '/../../../fixtures/update/duplicate-field-handler.php',
29 * Tests that field handlers are updated properly.
31 public function testViewsUpdate8004() {
34 // Load and initialize our test view.
35 $view = View::load('test_duplicate_field_handlers');
36 $data = $view->toArray();
37 // Check that the field is using the expected base table.
38 $this->assertEqual('node_field_data', $data['display']['default']['display_options']['fields']['nid']['table']);
39 $this->assertEqual('node_field_data', $data['display']['default']['display_options']['filters']['type']['table']);
40 $this->assertEqual('node_field_data', $data['display']['default']['display_options']['sorts']['vid']['table']);
41 $this->assertEqual('node_field_data', $data['display']['default']['display_options']['arguments']['nid']['table']);