You are here

public function NodeCreationTest::testNodeAddPageOrder in Drupal 9

Tests the order of the node types on the add page.

File

core/modules/node/tests/src/Functional/NodeCreationTest.php, line 51

Class

NodeCreationTest
Create a node and test saving it.

Namespace

Drupal\Tests\node\Functional

Code

public function testNodeAddPageOrder() {
  $this
    ->createContentType([
    'type' => 'bundle_1',
    'name' => 'Bundle 1',
  ]);
  $this
    ->createContentType([
    'type' => 'bundle_2',
    'name' => 'Aaa Bundle 2',
  ]);
  $admin_content_types = $this
    ->drupalCreateUser([
    'bypass node access',
  ]);
  $this
    ->drupalLogin($admin_content_types);
  $this
    ->drupalGet('node/add');
  $this
    ->assertSession()
    ->pageTextMatches('/Aaa Bundle 2(.*)Bundle 1/');
}