function ConditionFormTest::testConfigForm

Submit the condition_node_type_test_form to test condition forms.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Condition/ConditionFormTest.php, line 34
Contains \Drupal\system\Tests\Condition\ConditionFormTest.

Class

ConditionFormTest
Tests condition forms, configuration and execution.

Namespace

Drupal\system\Tests\Condition

Code

function testConfigForm() {
  $article = entity_create('node', array(
    'type' => 'article',
    'title' => $this
      ->randomName(),
  ));
  $article
    ->save();
  $this
    ->drupalGet('condition_test');
  $this
    ->assertField('bundles[article]', 'There is an article bundle selector.');
  $this
    ->assertField('bundles[page]', 'There is a page bundle selector.');
  $this
    ->drupalPost(NULL, array(
    'bundles[page]' => 'page',
    'bundles[article]' => 'article',
  ), t('Submit'));
  $this
    ->assertText('The bundles are article and page', 'The form component appropriately saved the bundles.');
  $this
    ->assertText('Executed successfully.', 'The form configured condition executed properly.');
}