function MultiStepNodeFormBasicOptionsTest::testMultiStepNodeFormBasicOptions

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

Tests changing the default values of basic options to ensure they persist.

File

modules/node/node.test, line 2200

Class

MultiStepNodeFormBasicOptionsTest
Tests basic options of multi-step node forms.

Code

function testMultiStepNodeFormBasicOptions() {
    $edit = array(
        'title' => 'a',
        'status' => FALSE,
        'promote' => FALSE,
        'sticky' => 1,
        'choice[new:0][chtext]' => 'a',
        'choice[new:1][chtext]' => 'a',
    );
    $this->drupalPost('node/add/poll', $edit, t('More choices'));
    $this->assertNoFieldChecked('edit-status', 'status stayed unchecked');
    $this->assertNoFieldChecked('edit-promote', 'promote stayed unchecked');
    $this->assertFieldChecked('edit-sticky', 'sticky stayed checked');
}

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