function NodeFormSaveChangedTimeTest::setUp

Same name in other branches
  1. 9 core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php \Drupal\Tests\node\Functional\NodeFormSaveChangedTimeTest::setUp()
  2. 8.9.x core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php \Drupal\Tests\node\Functional\NodeFormSaveChangedTimeTest::setUp()
  3. 11.x core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php \Drupal\Tests\node\Functional\NodeFormSaveChangedTimeTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php, line 38

Class

NodeFormSaveChangedTimeTest
Tests updating the changed time after API and FORM entity save.

Namespace

Drupal\Tests\node\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Create a node type.
    $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
    ]);
    $this->authorUser = $this->drupalCreateUser([
        'access content',
        'create article content',
        'edit any article content',
    ], 'author');
    $this->drupalLogin($this->authorUser);
    // Create one node of the above node type .
    $this->drupalCreateNode([
        'type' => 'article',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.