public function HijriNodeDisplayTest::testNoneDisplay in Hijri 3.0.x
File
- tests/
src/ Functional/ HijriNodeDisplayTest.php, line 174
Class
- HijriNodeDisplayTest
- Browser test base class for Hijri functional tests.
Namespace
Drupal\Tests\hijri\FunctionalCode
public function testNoneDisplay() {
$this
->drupalLogin($this
->createUser([
'administer hijri',
]));
$this
->drupalGet('admin/config/regional/date-time/hijri');
$this->assert
->statusCodeEquals(200);
$edit = [
'hijri_correction_value' => 0,
'hijri_types[]' => [
'article',
],
'hijri_display' => "none",
];
$this
->submitForm($edit, 'Save configuration');
$this
->drupalGet('admin/config/regional/date-time/hijri');
$this->account = $this
->drupalCreateUser();
$this
->drupalLogin($this->account);
$this->node = $this
->drupalCreateNode([
'type' => 'article',
'promote' => 1,
'uid' => $this->account
->id(),
]);
$this
->drupalGet('node/' . $this->node
->id());
$this->assert
->pageTextContainsOnce(t('Submitted by @username on @datetime', [
'@username' => $this->account
->getAccountName(),
'@datetime' => $this->date_formatter
->format($this->node
->getCreatedTime()),
]));
}