You are here

public function NodeRecurDateUNIXTestCase::testNodeRecurContentCreateDateUnixRepeatRequired in Node recur 7.2

File

tests/node_recur.test, line 315

Class

NodeRecurDateUNIXTestCase
Unix Date field tests for node recur

Code

public function testNodeRecurContentCreateDateUnixRepeatRequired() {

  // Date field
  $edit = array();
  $edit["instance[required]"] = 1;
  $this
    ->drupalPost('admin/structure/types/manage/repeating_node/fields/field_date_unix', $edit, t('Save settings'));
  $edit = array();
  $edit["title"] = 'Node Recur Node';
  $edit["field_date_simple[und][0][value][date]"] = '06/01/2025 - 15:45';
  $edit["field_date_iso[und][0][value][date]"] = '07/01/2025 - 15:45';
  $edit["field_date_unix[und][0][value][date]"] = '08/21/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_unix[und][0][rrule][FREQ]'] = 'WEEKLY';
  $edit['field_date_unix[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 28, 2025", 'August 28 2025 found');
  $this
    ->assertText("September 4, 2025", 'September 4 2025 found');
  $this
    ->assertText("September 11, 2025", 'September 11 2025 found');
  $this
    ->assertText("September 18, 2025", 'September 18 2025 found');
  $this
    ->assertText("September 25, 2025", 'September 25 2025 found');
  $this
    ->drupalPost(NULL, array(), t('Submit'));
  $this
    ->assertText('5 items have been generated.');
  $this
    ->drupalGet('node/1');
  $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/2');
  $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/3');
  $this
    ->assertText("September 4, 2025", 'September 4 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 11, 2025", 'September 11 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 18, 2025", 'September 18 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 25, 2025", 'September 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');
}