DateFormatsLockedTest.php in Drupal 9
File
core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\System;
use Drupal\Tests\BrowserTestBase;
class DateFormatsLockedTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public function testDateLocking() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('admin/config/regional/date-time');
$this
->assertSession()
->linkByHrefExists('admin/config/regional/date-time/formats/manage/short');
$this
->assertSession()
->linkByHrefNotExists('admin/config/regional/date-time/formats/manage/html_date');
$this
->assertSession()
->pageTextContains('Fallback date format');
$this
->assertSession()
->pageTextNotContains('short (locked)');
$this
->drupalGet('admin/config/regional/date-time/formats/manage/short');
$this
->assertSession()
->statusCodeEquals(200);
$this
->drupalGet('admin/config/regional/date-time/formats/manage/html_date');
$this
->assertSession()
->statusCodeEquals(403);
$this
->drupalGet('admin/config/regional/date-time/formats/manage/short/delete');
$this
->assertSession()
->statusCodeEquals(200);
$this
->drupalGet('admin/config/regional/date-time/formats/manage/html_date/delete');
$this
->assertSession()
->statusCodeEquals(403);
}
}