function PollDeleteChoiceTestCase::testChoiceRemoval in Drupal 7
File
- modules/poll/poll.test, line 784
- Tests for poll.module.
Class
- PollDeleteChoiceTestCase
Code
function testChoiceRemoval() {
$title = $this
->randomName();
$choices = array(
'First choice',
'Second choice',
'Third choice',
);
$poll_nid = $this
->pollCreate($title, $choices, FALSE);
$this
->assertTrue($poll_nid, 'Poll for choice deletion logic test created.');
$this
->drupalGet("node/{$poll_nid}/edit");
$edit['choice[chid:1][chtext]'] = '';
$this
->drupalPost(NULL, $edit, t('Save'));
$this
->drupalGet('poll');
$this
->clickLink($title);
$this
->assertNoText('First choice', 'First choice removed.');
$this
->assertText('Second choice', 'Second choice remains.');
$this
->assertText('Third choice', 'Third choice remains.');
}