You are here

public function MakemeetingPollAdminTestCase::testEmptyField in Make Meeting Scheduler 7.2

Test the creation of event content with multiple makmeeting values

File

./makemeeting.test, line 133
Makemeeting tests

Class

MakemeetingPollAdminTestCase
Test for the creation of a makemeeting poll.

Code

public function testEmptyField() {
  $this
    ->_testCreateField();

  // Removing choice
  $edit = array();
  $edit['title'] = $this
    ->randomName();
  $this
    ->drupalGet('node/add/event');
  $this
    ->drupalPostAJAX(NULL, $edit, array(
    'new:0' => t('Remove'),
  ));
  $this
    ->verbose($this->content);
  $this
    ->assertNoRaw('<td class="makemeeting-choice-date">');

  // Must not have answering form
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  $this
    ->assertNoRaw('<table class="makemeeting-table');

  // Must not have additional choice
  $this
    ->drupalGet('node/1/edit');
  $this
    ->assertNoRaw('<td class="makemeeting-choice-date">');

  // Removing choice after saving
  $edit = array();
  $edit['title'] = $this
    ->randomName();
  $this
    ->drupalPost('node/add/event', $edit, t('Save'));
  $this
    ->assertRaw('<table class="makemeeting-table');
  $this
    ->drupalGet('node/2/edit');
  $this
    ->assertRaw('<td class="makemeeting-choice-date">');
  $additional_stamp = strtotime('+1 day', REQUEST_TIME);
  $default_date = array(
    'month' => date('n', $additional_stamp),
    'day' => date('j', $additional_stamp),
    'year' => date('Y', $additional_stamp),
  );
  $key = _makemeeting_date_timestamp($default_date)
    ->format('d-m-Y');
  $this
    ->verbose($key);
  $this
    ->drupalPostAJAX(NULL, $edit, array(
    $key => t('Remove'),
  ));
  $this
    ->assertNoRaw('<td class="makemeeting-choice-date">');
  $this
    ->drupalPost(NULL, array(), t('Save'));
  $this
    ->assertNoRaw('<table class="makemeeting-table');
}