Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / dblog / tests / src / Functional / Update / DblogRecentLogsUsingViewsUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\dblog\Functional\Update;
4
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
6
7 /**
8  * Ensures that update hook that creates the watchdog view ran sucessfully.
9  *
10  * @group Update
11  */
12 class DblogRecentLogsUsingViewsUpdateTest extends UpdatePathTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   protected function setDatabaseDumpFiles() {
18     $this->databaseDumpFiles = [
19       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
20     ];
21   }
22
23   /**
24    * Ensures that update hook is run for dblog module.
25    */
26   public function testUpdate() {
27     // Make sure the watchog view doesn't exist before the updates.
28     $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog');
29     $this->assertNull($view);
30
31     $this->runUpdates();
32
33     // Ensure the watchdog view is present after run updates.
34     $view = \Drupal::entityTypeManager()->getStorage('view')->load('watchdog');
35     $displays = $view->get('display');
36
37     $this->assertIdentical($displays['page']['display_options']['path'], 'admin/reports/dblog', 'Recent logs message view exists.');
38   }
39
40 }