Pull merge.
[yaffs-website] / web / core / modules / views / tests / src / Functional / Update / BooleanFilterValuesUpdateTest.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 boolean field values.
10  *
11  * @see views_post_update_boolean_filter_values()
12  *
13  * @group Update
14  * @group legacy
15  */
16 class BooleanFilterValuesUpdateTest extends UpdatePathTestBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   protected function setDatabaseDumpFiles() {
22     $this->databaseDumpFiles = [
23       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
24       __DIR__ . '/../../../fixtures/update/boolean-filter-values.php',
25     ];
26   }
27
28   /**
29    * Tests that boolean filter values are updated properly.
30    */
31   public function testViewsPostUpdateBooleanFilterValues() {
32     $this->runUpdates();
33
34     // Load and initialize our test view.
35     $view = View::load('test_boolean_filter_values');
36     $data = $view->toArray();
37     // Check that the field is using the expected string value.
38     $this->assertIdentical('1', $data['display']['default']['display_options']['filters']['status']['value']);
39   }
40
41 }