Pull merge.
[yaffs-website] / web / core / modules / views / tests / src / Functional / Update / ViewsDataTableDependencyUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\views\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6 use Drupal\views\Views;
7
8 /**
9  * Tests the upgrade path for views data table provider dependencies.
10  *
11  * @see views_post_update_views_data_table_dependencies()
12  *
13  * @group Update
14  * @group legacy
15  */
16 class ViewsDataTableDependencyUpdateTest extends UpdatePathTestBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   protected function setDatabaseDumpFiles() {
22     $this->databaseDumpFiles = [
23       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
24       // This creates a view called test_table_dependency_update which has no
25       // dependencies.
26       __DIR__ . '/../../../fixtures/update/views-data-table-dependency.php',
27     ];
28   }
29
30   /**
31    * Tests that dependencies are correct after update.
32    */
33   public function testPostUpdate() {
34     $this->runUpdates();
35
36     // Load and initialize our test view.
37     $view = Views::getView('test_table_dependency_update');
38     $this->assertEquals(['module' => ['views_test_data']], $view->getDependencies());
39   }
40
41 }