function NodeCreationTest::testNodeAddPageOrder
Tests the order of the node types on the add page.
File
- 
              core/modules/ node/ tests/ src/ Functional/ NodeCreationTest.php, line 58 
Class
- NodeCreationTest
- Create a node and test saving it.
Namespace
Drupal\Tests\node\FunctionalCode
public function testNodeAddPageOrder() : void {
  $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/');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
