3 namespace Drupal\Tests\system\Functional\System;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests the locked functionality of date formats.
12 class DateFormatsLockedTest extends BrowserTestBase {
15 * Tests attempts at listing, editing, and deleting locked date formats.
17 public function testDateLocking() {
18 $this->drupalLogin($this->rootUser);
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
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)');
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);
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);