Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / Functional / Update / SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\system\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6
7 /**
8  * Tests the upgrade path for converting seven secondary local tasks into a block.
9  *
10  * @see https://www.drupal.org/node/2569529
11  *
12  * @group system
13  */
14 class SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest extends UpdatePathTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public function setDatabaseDumpFiles() {
20     $this->databaseDumpFiles = [
21       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
22       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php',
23     ];
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   protected function setUp() {
30     parent::setUp();
31     /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
32     $theme_handler = \Drupal::service('theme_handler');
33     $theme_handler->refreshInfo();
34   }
35
36   /**
37    * Tests that local actions/tasks are being converted into blocks.
38    */
39   public function testUpdateHookN() {
40     $this->runUpdates();
41
42     /** @var \Drupal\block\BlockInterface $block_storage */
43     $block_storage = \Drupal::entityManager()->getStorage('block');
44
45     // Disable maintenance mode.
46     // @todo Can be removed once maintenance mode is automatically turned off
47     // after updates in https://www.drupal.org/node/2435135.
48     \Drupal::state()->set('system.maintenance_mode', FALSE);
49
50     // We finished updating so we can log in the user now.
51     $this->drupalLogin($this->rootUser);
52
53     // Local actions are visible on the content listing page.
54     $this->drupalGet('admin/structure/block');
55     $action_link = $this->cssSelect('#secondary-tabs-title');
56     $this->assertTrue($action_link);
57   }
58
59 }