You are here

public function NodeRecurEndDateWeekendTestCase::testNodeRecurContentCreateDateRepeatExcludeWeekendsTrue in Node recur 7.2

File

tests/node_recur.test, line 658

Class

NodeRecurEndDateWeekendTestCase
Weekend field tests for node recur

Code

public function testNodeRecurContentCreateDateRepeatExcludeWeekendsTrue() {
  $edit = array();
  $edit["title"] = 'Node Recur Node';
  $edit["field_date_simple[und][0][value][date]"] = '08/20/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';
  $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_simple[und][0][rrule][FREQ]'] = 'DAILY';
  $edit['field_date_simple[und][0][rrule][count_child]'] = 7;
  $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 21, 2025 - 15:45", 'August 21 2025 found');
  $this
    ->assertText("August 22, 2025 - 15:45", 'August 22 2025 found');
  $this
    ->assertNoText("August 23, 2025 - 15:45", 'August 23 2025 NOT found');
  $this
    ->assertNoText("August 24, 2025 - 15:45", 'August 24 2025 NOT found');
  $this
    ->assertText("August 25, 2025 - 15:45", 'August 25 2025 found');
  $this
    ->assertText("August 26, 2025 - 15:45", 'August 26 2025 found');
  $this
    ->assertText("August 27, 2025 - 15:45", 'August 27 2025 found');
  $this
    ->assertText("August 28, 2025 - 15:45", 'August 28 2025 found');
  $this
    ->assertText("August 29, 2025 - 15:45", 'August 29 2025 found');
  $this
    ->drupalPost(NULL, array(), t('Submit'));
  $this
    ->assertText('7 items have been generated.');
  $this
    ->drupalGet('node/1');
  $this
    ->assertText("August 20, 2025", '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 21, 2025", 'August 21 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("August 22, 2025", 'August 22 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("August 25, 2025", 'August 25 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("August 26, 2025", 'August 26 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("August 27, 2025", '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/7');
  $this
    ->assertText("August 28, 2025", 'August 28 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/8');
  $this
    ->assertText("August 29, 2025", 'August 29 2025 found');
  $this
    ->assertText('June 1, 2025 - 15:45', 'June 01 2025 found');
  $this
    ->assertText('July 1, 2025 - 15:45', 'July 01 2025 found');
}