Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / rest / src / Tests / Update / RestExportAuthCorrectionUpdateTest.php
1 <?php
2
3 namespace Drupal\rest\Tests\Update;
4
5 use Drupal\system\Tests\Update\UpdatePathTestBase;
6
7 /**
8  * Ensures that update hook is run properly for REST Export config.
9  *
10  * @group Update
11  */
12 class RestExportAuthCorrectionUpdateTest 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       __DIR__ . '/../../../tests/fixtures/update/rest-export-with-authentication-correction.php',
21     ];
22   }
23
24   /**
25    * Ensures that update hook is run for "rest" module.
26    */
27   public function testUpdate() {
28     $this->runUpdates();
29
30     // Get particular view.
31     $view = \Drupal::entityTypeManager()->getStorage('view')->load('rest_export_with_authorization_correction');
32     $displays = $view->get('display');
33     $this->assertIdentical($displays['rest_export_1']['display_options']['auth'], ['cookie'], 'Cookie is used for authentication');
34   }
35
36 }