79c3beaacf1f3c1adaac8e9322b4f97cee755085
[yaffs-website] / web / core / modules / block / tests / src / Functional / Update / BlockConditionMissingSchemaUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\block\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6
7 /**
8  * Tests the upgrade path for block with conditions missing context.
9  *
10  * @see https://www.drupal.org/node/2811519
11  *
12  * @group Update
13  * @group legacy
14  */
15 class BlockConditionMissingSchemaUpdateTest extends UpdatePathTestBase {
16
17   /**
18    * This test does not have a failed update but the configuration has missing
19    * schema so can not do the full post update testing offered by
20    * UpdatePathTestBase.
21    *
22    * @var bool
23    *
24    * @see \Drupal\system\Tests\Update\UpdatePathTestBase::runUpdates()
25    */
26   protected $checkFailedUpdates = FALSE;
27
28   /**
29    * {@inheritdoc}
30    */
31   protected static $modules = ['block_test', 'language'];
32
33   /**
34    * {@inheritdoc}
35    */
36   protected function setDatabaseDumpFiles() {
37     $this->databaseDumpFiles = [
38       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
39       __DIR__ . '/../../../fixtures/update/drupal-8.block-test-enabled-missing-schema.php',
40     ];
41   }
42
43   /**
44    * Tests that block context mapping is updated properly.
45    */
46   public function testUpdateHookN() {
47     $this->runUpdates();
48     $this->drupalGet('<front>');
49     // If the block is fixed by block_post_update_fix_negate_in_conditions()
50     // then it will be visible.
51     $this->assertText('Test missing schema on conditions');
52   }
53
54 }