diff --git a/scheduler.test b/scheduler.test
index 87c0ce8..768d507 100644
--- a/scheduler.test
+++ b/scheduler.test
@@ -84,4 +84,175 @@ class SchedulerTestCase extends DrupalWebTestCase {
       $this->assertNoText($body, t('Node is unpublished'));
     }
   }
+
+  /**
+   * Tests creating and editing nodes with required scheduling enabled.
+   */
+  function testRequiredScheduling() {
+    $this->drupalLogin($this->admin_user);
+
+    // Define test scenarios with expected results.
+    $test_cases = array(
+      // 1. Test scenarios that require scheduled publishing.
+      // When creating a new published node it is required to enter a
+      // publication date. The node will be unpublished on form submit.
+      array(
+        'required' => 'publish',
+        'operation' => 'add',
+        'status' => 1,
+        'expected' => 'required',
+        'message' => 'When scheduled publishing is required and a new published node is created, entering a date in the publish on field is required.',
+      ),
+
+      // When creating a new unpublished node it is required to enter a
+      // publication date.
+      array(
+        'required' => 'publish',
+        'operation' => 'add',
+        'status' => 0,
+        'expected' => 'required',
+        'message' => 'When scheduled publishing is required and a new unpublished node is created, entering a date in the publish on field is required.',
+      ),
+
+      // When editing a published node it is not needed to enter a publication
+      // date since the node is already published.
+      array(
+        'required' => 'publish',
+        'operation' => 'edit',
+        'scheduled' => 0,
+        'status' => 1,
+        'expected' => 'not required',
+        'message' => 'When scheduled publishing is required and an existing published, unscheduled node is edited, entering a date in the publish on field is not required.',
+      ),
+
+      // When editing an unpublished node that is scheduled for publication it
+      // is required to enter a publication date.
+      array(
+        'required' => 'publish',
+        'operation' => 'edit',
+        'scheduled' => 1,
+        'status' => 0,
+        'expected' => 'required',
+        'message' => 'When scheduled publishing is required and an existing unpublished, scheduled node is edited, entering a date in the publish on field is required.',
+      ),
+
+      // When editing an unpublished node that is not scheduled for publication
+      // it is not required to enter a publication date since this means that
+      // the node has already gone through a publication > unpublication cycle.
+      array(
+        'required' => 'publish',
+        'operation' => 'edit',
+        'scheduled' => 0,
+        'status' => 0,
+        'expected' => 'not required',
+        'message' => 'When scheduled publishing is required and an existing unpublished, unscheduled node is edited, entering a date in the publish on field is not required.',
+      ),
+
+      // 2. Test scenarios that require scheduled unpublishing.
+      // When creating a new published node it is required to enter an
+      // unpublication date.
+      array(
+        'required' => 'unpublish',
+        'operation' => 'add',
+        'status' => 1,
+        'expected' => 'required',
+        'message' => 'When scheduled unpublishing is required and a new published node is created, entering a date in the unpublish on field is required.',
+      ),
+
+      // When creating a new unpublished node it is required to enter an
+      // unpublication date since it is to be expected that the node will be
+      // published at some point and should subsequently be unpublished.
+      array(
+        'required' => 'unpublish',
+        'operation' => 'add',
+        'status' => 0,
+        'expected' => 'required',
+        'message' => 'When scheduled unpublishing is required and a new unpublished node is created, entering a date in the unpublish on field is required.',
+      ),
+
+      // When editing a published node it is required to enter an unpublication
+      // date.
+      array(
+        'required' => 'unpublish',
+        'operation' => 'edit',
+        'scheduled' => 0,
+        'status' => 1,
+        'expected' => 'required',
+        'message' => 'When scheduled unpublishing is required and an existing published, unscheduled node is edited, entering a date in the unpublish on field is required.',
+      ),
+
+      // When editing an unpublished node that is scheduled for publication it
+      // it is required to enter an unpublication date.
+      array(
+        'required' => 'unpublish',
+        'operation' => 'edit',
+        'scheduled' => 1,
+        'status' => 0,
+        'expected' => 'required',
+        'message' => 'When scheduled unpublishing is required and an existing unpublished, scheduled node is edited, entering a date in the unpublish on field is required.',
+      ),
+
+      // When editing an unpublished node that is not scheduled for publication
+      // it is not required to enter an unpublication date since this means that
+      // the node has already gone through a publication - unpublication cycle.
+      array(
+        'required' => 'unpublish',
+        'operation' => 'edit',
+        'scheduled' => 0,
+        'status' => 0,
+        'expected' => 'not required',
+        'message' => 'When scheduled unpublishing is required and an existing unpublished, unscheduled node is edited, entering a date in the unpublish on field is not required.',
+      ),
+    );
+
+    foreach ($test_cases as $test_case) {
+      // Enable required (un)publishing as stipulated by the test case.
+      variable_set('scheduler_publish_required_page', $test_case['required'] == 'publish');
+      variable_set('scheduler_unpublish_required_page', $test_case['required'] == 'unpublish');
+
+      // If the test case requires editing a node, we need to create one first.
+      $title = $this->randomString();
+      if ($test_case['operation'] == 'edit') {
+        $options = array(
+          'title' => $title,
+          'type' => 'page',
+          'status' => !empty($test_case['status']),
+          'publish_on' => !empty($test_case['scheduled']) ? strtotime('+ 1 day') : 0,
+        );
+        $node = $this->drupalCreateNode($options);
+      }
+
+      // Only fill in the title and status when creating a new node. When we are
+      // editing an existing node these fields are already filled in.
+      $edit = $test_case['operation'] == 'add' ? array(
+        'title' => $title,
+        'status' => $test_case['status'],
+      ) : array();
+
+      // Make sure the publication date fields are empty so we can check if they
+      // throw form validation errors when they are required.
+      $edit += array(
+        'publish_on' => '',
+        'unpublish_on' => '',
+      );
+
+      $path = $test_case['operation'] == 'add' ? 'node/add/page' : 'node/' . $node->nid . '/edit';
+      $this->drupalPost($path, $edit, t('Save'));
+
+      // Check for the expected result.
+      switch ($test_case['expected']) {
+        case 'required':
+          $string = t('!name field is required.', array('!name' => ucfirst($test_case['required']) . ' on'));
+          $this->assertRaw($string, $test_case['message']);
+          break;
+
+        case 'not required':
+          $string = '@type %title has been ' . ($test_case['operation'] == 'add' ? 'created' : 'updated') . '.';
+          $args = array('@type' => 'Basic page', '%title' => $title);
+          $this->assertRaw(t($string, $args), $test_case['message']);
+          break;
+      }
+    }
+  }
+
 }
