Updated to Drupal 8.5. Core Media not yet in use.
[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  */
15 class ViewsDataTableDependencyUpdateTest extends UpdatePathTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   protected function setDatabaseDumpFiles() {
21     $this->databaseDumpFiles = [
22       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
23       // This creates a view called test_table_dependency_update which has no
24       // dependencies.
25       __DIR__ . '/../../../fixtures/update/views-data-table-dependency.php',
26     ];
27   }
28
29   /**
30    * Tests that dependencies are correct after update.
31    */
32   public function testPostUpdate() {
33     $this->runUpdates();
34
35     // Load and initialize our test view.
36     $view = Views::getView('test_table_dependency_update');
37     $this->assertEquals(['module' => ['views_test_data']], $view->getDependencies());
38   }
39
40 }