DateFormatsLockedTest.php in Drupal 8
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
->assertLinkByHref('admin/config/regional/date-time/formats/manage/short');
$this
->assertNoLinkByHref('admin/config/regional/date-time/formats/manage/html_date');
$this
->assertText('Fallback date format');
$this
->assertNoText('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);
}
}