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 placeholder text.
11 * @see views_post_update_filter_placeholder_text()
16 class PlaceholderTextUpdateTest 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/filter-placeholder-text.php',
29 * Tests that boolean filter values are updated properly.
31 public function testViewsPostUpdatePlaceholderText() {
34 // Load and initialize our test view.
35 $view = View::load('placeholder_text_test');
36 $data = $view->toArray();
37 // Check that new settings exist.
38 $this->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['title']['expose']);
39 $this->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
40 $this->assertArrayHasKey('min_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
41 $this->assertArrayHasKey('max_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);