Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / src / Functional / System / DateFormatsLockedTest.php
1 <?php
2
3 namespace Drupal\Tests\system\Functional\System;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests the locked functionality of date formats.
9  *
10  * @group system
11  */
12 class DateFormatsLockedTest extends BrowserTestBase {
13
14   /**
15    * Tests attempts at listing, editing, and deleting locked date formats.
16    */
17   public function testDateLocking() {
18     $this->drupalLogin($this->rootUser);
19
20     // Locked date formats are not linked on the listing page, locked date
21     // formats are clearly marked as such; unlocked formats are not marked as
22     // "locked".
23     $this->drupalGet('admin/config/regional/date-time');
24     $this->assertLinkByHref('admin/config/regional/date-time/formats/manage/short');
25     $this->assertNoLinkByHref('admin/config/regional/date-time/formats/manage/html_date');
26     $this->assertText('Fallback date format');
27     $this->assertNoText('short (locked)');
28
29     // Locked date formats are not editable.
30     $this->drupalGet('admin/config/regional/date-time/formats/manage/short');
31     $this->assertResponse(200);
32     $this->drupalGet('admin/config/regional/date-time/formats/manage/html_date');
33     $this->assertResponse(403);
34
35     // Locked date formats are not deletable.
36     $this->drupalGet('admin/config/regional/date-time/formats/manage/short/delete');
37     $this->assertResponse(200);
38     $this->drupalGet('admin/config/regional/date-time/formats/manage/html_date/delete');
39     $this->assertResponse(403);
40   }
41
42 }