You are here

public function NodeRecurEndDateTestCase::testNodeRecurContentCreateEndDateRepeat in Node recur 7.2

File

tests/node_recur.test, line 523

Class

NodeRecurEndDateTestCase
End Date field tests for node recur

Code

public function testNodeRecurContentCreateEndDateRepeat() {
  $edit = array();
  $edit["title"] = 'Node Recur Node';
  $edit["field_date_simple[und][0][value][date]"] = '05/01/2025 - 15:45';
  $edit["field_date_iso[und][0][value][date]"] = '06/01/2025 - 15:45';
  $edit["field_date_unix[und][0][value][date]"] = '07/01/2025 - 15:45';
  $edit["field_date_range[und][0][value][date]"] = '08/20/2025 - 09:00';
  $edit["field_date_range[und][0][value2][date]"] = '08/20/2025 - 15:45';
  $this
    ->drupalPost('node/add/repeating-node', $edit, t('Save'));
  $this
    ->assertText("has been created", 'Node has been created');
  $this
    ->clickLink(t('Repeat this repeating node'));
  $edit = array();
  $edit['field_date_range[und][0][rrule][FREQ]'] = 'WEEKLY';
  $edit['field_date_range[und][0][rrule][count_child]'] = 5;
  $this
    ->drupalPost(NULL, $edit, t('Generate'));
  $this
    ->assertText("This action cannot be undone. Please confirm that the dates above are accurate and that the repeating node information is correct. Editing this repeating node afterwards will not edit every repeating node generated here.", 'Warning message');
  $this
    ->assertText("August 27, 2025 - 09:00 to 15:45", 'August 27 2025 found');
  $this
    ->assertText("September 3, 2025 - 09:00 to 15:45", 'September 3 2025 found');
  $this
    ->assertText("September 10, 2025 - 09:00 to 15:45", 'September 10 2025 found');
  $this
    ->assertText("September 17, 2025 - 09:00 to 15:45", 'September 17 2025 found');
  $this
    ->assertText("September 24, 2025 - 09:00 to 15:45", 'September 24 2025 found');
  $this
    ->drupalPost(NULL, array(), t('Submit'));
  $this
    ->assertText('5 items have been generated.');
  $this
    ->drupalGet('node/1');
  $this
    ->assertText("August 20, 2025 - 09:00 to 15:45", 'August 20 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
  $this
    ->drupalGet('node/2');
  $this
    ->assertText("August 27, 2025 - 09:00 to 15:45", 'August 27 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
  $this
    ->drupalGet('node/3');
  $this
    ->assertText("September 3, 2025 - 09:00 to 15:45", 'September 3 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
  $this
    ->drupalGet('node/4');
  $this
    ->assertText("September 10, 2025 - 09:00 to 15:45", 'September 10 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
  $this
    ->drupalGet('node/5');
  $this
    ->assertText("September 17, 2025 - 09:00 to 15:45", 'September 17 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
  $this
    ->drupalGet('node/6');
  $this
    ->assertText("September 24, 2025 - 09:00 to 15:45", 'September 24 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
}