Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / views / tests / src / Functional / Update / PlaceholderTextUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\views\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6 use Drupal\views\Entity\View;
7
8 /**
9  * Tests the upgrade path for placeholder text.
10  *
11  * @see views_post_update_filter_placeholder_text()
12  *
13  * @group Update
14  */
15 class PlaceholderTextUpdateTest extends UpdatePathTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   protected function setDatabaseDumpFiles() {
21     $this->databaseDumpFiles = [
22       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
23       __DIR__ . '/../../../fixtures/update/filter-placeholder-text.php',
24     ];
25   }
26
27   /**
28    * Tests that boolean filter values are updated properly.
29    */
30   public function testViewsPostUpdatePlaceholderText() {
31     $this->runUpdates();
32
33     // Load and initialize our test view.
34     $view = View::load('placeholder_text_test');
35     $data = $view->toArray();
36     // Check that new settings exist.
37     $this->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['title']['expose']);
38     $this->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
39     $this->assertArrayHasKey('min_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
40     $this->assertArrayHasKey('max_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
41   }
42
43 }