PlaceholderTextUpdateTest.php in Drupal 8
File
core/modules/views/tests/src/Functional/Update/PlaceholderTextUpdateTest.php
View source
<?php
namespace Drupal\Tests\views\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Drupal\views\Entity\View;
class PlaceholderTextUpdateTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
__DIR__ . '/../../../fixtures/update/filter-placeholder-text.php',
];
}
public function testViewsPostUpdatePlaceholderText() {
$this
->runUpdates();
$view = View::load('placeholder_text_test');
$data = $view
->toArray();
$this
->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['title']['expose']);
$this
->assertArrayHasKey('placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
$this
->assertArrayHasKey('min_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
$this
->assertArrayHasKey('max_placeholder', $data['display']['default']['display_options']['filters']['created']['expose']);
}
}