Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[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  * @group legacy
14  */
15 class SevenSecondaryLocalTasksConvertedIntoBlockUpdateTest extends UpdatePathTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function setDatabaseDumpFiles() {
21     $this->databaseDumpFiles = [
22       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
23       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.seven-secondary-local-tasks-block-2569529.php',
24     ];
25   }
26
27   /**
28    * {@inheritdoc}
29    */
30   protected function setUp() {
31     parent::setUp();
32     /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
33     $theme_handler = \Drupal::service('theme_handler');
34     $theme_handler->refreshInfo();
35   }
36
37   /**
38    * Tests that local actions/tasks are being converted into blocks.
39    */
40   public function testUpdateHookN() {
41     $this->runUpdates();
42
43     /** @var \Drupal\block\BlockInterface $block_storage */
44     $block_storage = \Drupal::entityManager()->getStorage('block');
45
46     // Disable maintenance mode.
47     // @todo Can be removed once maintenance mode is automatically turned off
48     // after updates in https://www.drupal.org/node/2435135.
49     \Drupal::state()->set('system.maintenance_mode', FALSE);
50
51     // We finished updating so we can log in the user now.
52     $this->drupalLogin($this->rootUser);
53
54     // Local actions are visible on the content listing page.
55     $this->drupalGet('admin/structure/block');
56     $action_link = $this->cssSelect('#secondary-tabs-title');
57     $this->assertTrue($action_link);
58   }
59
60 }