You are here

public function NodeRecurExtendedDatesTestCase::testNodeRecurContentCreateDateRepeatExtended in Node recur 7.2

File

tests/node_recur.test, line 808

Class

NodeRecurExtendedDatesTestCase
Weekend field tests for node recur

Code

public function testNodeRecurContentCreateDateRepeatExtended() {
  $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]"] = '01/20/2025 - 09:45';
  $edit["field_date_range[und][0][value2][date]"] = '01/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]'] = 'MONTHLY';
  $edit['field_date_range[und][0][rrule][range_of_repeat]'] = 'UNTIL';
  $edit['field_date_range[und][0][rrule][until_child][datetime][date]'] = '11/30/2030';
  $edit['field_date_range[und][0][rrule][monthly][BYMONTHDAY_BYMONTH_child][BYMONTHDAY]'] = 10;
  $edit['field_date_range[exclude_weekends]'] = FALSE;
  $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
    ->assertNoText("January 10, 2025 - 09:45 to 15:45", 'January 10 2025 NOT found');
  $this
    ->assertText("February 10, 2025 - 09:45 to 15:45", 'February 10 2025 found');
  $this
    ->assertText("March 10, 2025 - 09:45 to 15:45", 'March 10 2025 found');
  $this
    ->assertText("April 10, 2025 - 09:45 to 15:45", 'April 10 2025 found');
  $this
    ->assertText("May 10, 2025 - 09:45 to 15:45", 'May 10 2025 found');
  $this
    ->assertText("June 10, 2025 - 09:45 to 15:45", 'June 10 2025 found');
  $this
    ->assertText("July 10, 2025 - 09:45 to 15:45", 'July 10 2025 found');
  $this
    ->assertText("August 10, 2025 - 09:45 to 15:45", 'August 10 2025 found');
  $this
    ->assertText("September 10, 2025 - 09:45 to 15:45", 'September 10 2025 found');
  $this
    ->assertText("October 10, 2025 - 09:45 to 15:45", 'October 10 2025 found');
  $this
    ->assertText("November 10, 2030 - 09:45 to 15:45", 'November 10 2030 found');
  $this
    ->drupalPost(NULL, array(), t('Submit'));
  $this
    ->assertText('items have been generated.');
}