diff --git a/tests/scheduler.test b/tests/scheduler.test
index 11731a2..3b5c33d 100644
--- a/tests/scheduler.test
+++ b/tests/scheduler.test
@@ -21,28 +21,31 @@ abstract class SchedulerTestBase extends DrupalWebTestCase {
    *
    * @var object
    */
-  protected $admin_user;
+  protected $adminUser;
 
   /**
    * Common settings and options.
    */
-  function commonSettings() {
+  public function commonSettings() {
 
     // Create a 'Basic Page' content type.
     $this->drupalCreateContentType(array('type' => 'page', 'name' => t('Basic page')));
 
     // Create an administrator user.
-    $this->admin_user = $this->drupalCreateUser(array(
+    // 'access site reports' is required for admin/reports/dblog.
+    // 'administer site configuration' is required for admin/reports/status.
+    // 'view scheduled content' is required for admin/content/scheduler.
+    $this->adminUser = $this->drupalCreateUser(array(
       'access content',
-      'access site reports',            // required for admin/reports/dblog
+      'access site reports',
       'administer nodes',
       'administer scheduler',
-      'administer site configuration',  // required for admin/reports/status
+      'administer site configuration',
       'create page content',
       'delete own page content',
       'edit own page content',
       'schedule publishing of nodes',
-      'view scheduled content',         // required for admin/content/scheduler
+      'view scheduled content',
       'view own unpublished content',
     ));
 
@@ -60,14 +63,14 @@ abstract class SchedulerTestBase extends DrupalWebTestCase {
    * @param bool $scheduler_cron_only
    *   TRUE to only run Scheduler cron, FALSE to run default full Drupal cron.
    */
-  function helpTestScheduler($edit, $scheduler_cron_only = FALSE) {
+  public function helpTestScheduler(array $edit, $scheduler_cron_only = FALSE) {
     // Add a page.
     $langcode = LANGUAGE_NONE;
     $title = $this->randomName();
     $edit["title"] = $title;
     $body = $this->randomName();
     $edit["body[$langcode][0][value]"] = $body;
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->drupalPost('node/add/page', $edit, t('Save'));
     $node = $this->drupalGetNodeByTitle($title);
     // Show the specific page for an anonymous visitor, then assert that the
@@ -118,7 +121,7 @@ abstract class SchedulerTestBase extends DrupalWebTestCase {
    * @return object
    *   The updated node, after scheduled (un)publication.
    */
-  function schedule($node, $action = 'publish') {
+  public function schedule($node, $action = 'publish') {
     // Simulate scheduling by setting the (un)publication date in the past and
     // running cron.
     $node->{$action . '_on'} = strtotime('-1 day', REQUEST_TIME);
@@ -139,10 +142,10 @@ abstract class SchedulerTestBase extends DrupalWebTestCase {
    * @param string $group
    *   The type of assertion - examples are "Browser", "PHP".
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
-  function assertRevisionLogMessage($nid, $value, $message = '', $group = 'Other') {
+  public function assertRevisionLogMessage($nid, $value, $message = '', $group = 'Other') {
     $log_message = db_select('node_revision', 'r')
       ->fields('r', array('log'))
       ->condition('nid', $nid)
@@ -165,10 +168,10 @@ abstract class SchedulerTestBase extends DrupalWebTestCase {
    * @param string $group
    *   The type of assertion - examples are "Browser", "PHP".
    *
-   * @return
+   * @return bool
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
-  function assertRevisionCount($nid, $value, $message = '', $group = 'Other') {
+  public function assertRevisionCount($nid, $value, $message = '', $group = 'Other') {
     $count = db_select('node_revision', 'r')
       ->fields('r', array('vid'))
       ->condition('nid', $nid)
@@ -177,12 +180,14 @@ abstract class SchedulerTestBase extends DrupalWebTestCase {
       ->fetchColumn();
     return $this->assertEqual($count, $value, $message, $group);
   }
+
 }
 
 /**
  * Tests the scheduler interface.
  */
 class SchedulerFunctionalTest extends SchedulerTestBase {
+
   /**
    * {@inheritdoc}
    */
@@ -197,7 +202,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
   /**
    * {@inheritdoc}
    */
-  function setUp() {
+  public function setUp() {
     parent::setUp('scheduler', 'dblog');
     parent::commonSettings();
   }
@@ -208,7 +213,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
    * @param bool $scheduler_cron_only
    *   TRUE to only run Scheduler cron, FALSE to run default full Drupal cron.
    */
-  function testScheduler($scheduler_cron_only = FALSE) {
+  public function testScheduler($scheduler_cron_only = FALSE) {
     // Create node values. Set time to one hour in the future.
     $edit = array(
       'publish_on' => format_date(time() + 3600, 'custom', 'Y-m-d H:i:s'),
@@ -231,7 +236,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
    *
    * @uses testScheduler()
    */
-  function testSchedulerWithOnlySchedulerCronAndAnonymousPageCache() {
+  public function testSchedulerWithOnlySchedulerCronAndAnonymousPageCache() {
     // Cache pages for anonymous users.
     variable_set('cache', 1);
     // Instruct scheduler to clear caches itself, instead of relying on
@@ -248,7 +253,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
    */
   public function testSchedulerPastDates() {
     // Log in.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Create an unpublished page node.
     $node = $this->drupalCreateNode(array('type' => 'page', 'status' => FALSE));
@@ -260,13 +265,13 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
       'publish_on' => format_date(strtotime('-1 day', REQUEST_TIME), 'custom', 'Y-m-d H:i:s'),
     );
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertRaw(t("The 'publish on' date must be in the future"), 'An error message is shown when the publication date is in the past and the "error" behavior is chosen.');
+    $this->assertText("The 'publish on' date must be in the future", 'An error message is shown when the publication date is in the past and the "error" behavior is chosen.');
 
     // Test the 'publish' behavior: the node should be published immediately.
     variable_set('scheduler_publish_past_date_page', 'publish');
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertNoRaw(t("The 'publish on' date must be in the future"), 'No error message is shown when the publication date is in the past and the "publish" behavior is chosen.');
-    $this->assertRaw(t('@type %title has been updated.', array('@type' => t('Basic page'), '%title' => check_plain($edit['title']))), 'The node is saved successfully when the publication date is in the past and the "publish" behavior is chosen.');
+    $this->assertNoText("The 'publish on' date must be in the future", 'No error message is shown when the publication date is in the past and the "publish" behavior is chosen.');
+    $this->assertText(sprintf('%s %s has been updated.', 'Basic page', $edit['title']), 'The node is saved successfully when the publication date is in the past and the "publish" behavior is chosen.');
 
     // Reload the changed node and check that it is published.
     $node = node_load($node->nid, NULL, TRUE);
@@ -276,9 +281,9 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     // published on the next cron run.
     variable_set('scheduler_publish_past_date_page', 'schedule');
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertNoRaw(t("The 'publish on' date must be in the future"), 'No error message is shown when the publication date is in the past and the "schedule" behavior is chosen.');
-    $this->assertRaw(t('@type %title has been updated.', array('@type' => t('Basic page'), '%title' => check_plain($edit['title']))), 'The node is saved successfully when the publication date is in the past and the "schedule" behavior is chosen.');
-    $this->assertRaw(t('This post is unpublished and will be published @publish_time.', array('@publish_time' => $edit['publish_on'])), 'The node is scheduled to be published when the publication date is in the past and the "schedule" behavior is chosen.');
+    $this->assertNoText("The 'publish on' date must be in the future", 'No error message is shown when the publication date is in the past and the "schedule" behavior is chosen.');
+    $this->assertText(sprintf('%s %s has been updated.', 'Basic page', check_plain($edit['title'])), 'The node is saved successfully when the publication date is in the past and the "schedule" behavior is chosen.');
+    $this->assertText(sprintf('This post is unpublished and will be published %s.', $edit['publish_on']), 'The node is scheduled to be published when the publication date is in the past and the "schedule" behavior is chosen.');
 
     // Reload the node and check that it is unpublished but scheduled correctly.
     $node = node_load($node->nid, NULL, TRUE);
@@ -337,8 +342,8 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
   /**
    * Tests if options can both be displayed as extra fields and vertical tabs.
    */
-  function testExtraFields() {
-    $this->drupalLogin($this->admin_user);
+  public function testExtraFields() {
+    $this->drupalLogin($this->adminUser);
 
     // Test if the options are shown as vertical tabs by default.
     $this->drupalGet('node/add/page');
@@ -357,21 +362,19 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     $this->assertTrue($this->xpath('//fieldset[@id = "edit-scheduler-settings" and not(contains(@class, "collapsed"))]'), 'The scheduler options are shown as an expanded fieldset.');
   }
 
-
-
   /**
    * Tests creating and editing nodes with required scheduling enabled.
    */
-  function testRequiredScheduling() {
-    $this->drupalLogin($this->admin_user);
+  public function testRequiredScheduling() {
+    $this->drupalLogin($this->adminUser);
 
     // Define test scenarios with expected results.
     $test_cases = array(
-      // The 1-10 numbering used below matches the test cases described in
-      // http://drupal.org/node/1198788#comment-7816119
 
       // A. Test scenarios that require scheduled publishing.
-
+      // The 1-10 numbering used below matches the test cases described in
+      // http://drupal.org/node/1198788#comment-7816119
+      //
       // When creating a new unpublished node it is required to enter a
       // publication date.
       array(
@@ -432,7 +435,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
       ),
 
       // B. Test scenarios that require scheduled unpublishing.
-
+      //
       // 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.
@@ -537,14 +540,12 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
       // 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['id'] . '. ' . $test_case['message']);
+          $this->assertText(sprintf('%s field is required.', ucfirst($test_case['required']) . ' on'), $test_case['id'] . '. ' . $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['id'] . '. ' . $test_case['message']);
+          $op = $test_case['operation'] == 'add' ? 'created' : 'updated';
+          $this->assertText(sprintf('%s %s has been %s.', 'Basic page', $title, $op), $test_case['id'] . '. ' . $test_case['message']);
           break;
       }
     }
@@ -556,8 +557,8 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
    * The 'required' checks and 'dates in the past' checks are handled in other
    * tests. This test checks validation when the two fields interact.
    */
-  function testValidationDuringEdit() {
-    $this->drupalLogin($this->admin_user);
+  public function testValidationDuringEdit() {
+    $this->drupalLogin($this->adminUser);
 
     // Set unpublishing to be required.
     variable_set('scheduler_unpublish_required_page', TRUE);
@@ -569,7 +570,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
       'publish_on' => date('Y-m-d H:i:s', strtotime('+1 day', REQUEST_TIME)),
     );
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertRaw(t("If you set a 'publish-on' date then you must also set an 'unpublish-on' date."), 'Validation prevents entering a publish-on date with no unpublish-on date if unpublishing is required.');
+    $this->assertText("If you set a 'publish-on' date then you must also set an 'unpublish-on' date.", 'Validation prevents entering a publish-on date with no unpublish-on date if unpublishing is required.');
 
     // Create an unpublished page node, then edit the node and check that if the
     // status is changed to published, then an unpublish-on date is also needed.
@@ -578,7 +579,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
       'status' => TRUE,
     );
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertRaw(t("To publish this node you must also set an 'unpublish-on' date."), 'Validation prevents publishing the node directly without an unpublish-on date if unpublishing is required.');
+    $this->assertText("To publish this node you must also set an 'unpublish-on' date.", 'Validation prevents publishing the node directly without an unpublish-on date if unpublishing is required.');
 
     // Create an unpublished page node, edit the node and check that if both
     // dates are entered then the unpublish date is later than the publish date.
@@ -588,25 +589,21 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
       'unpublish_on' => date('Y-m-d H:i:s', strtotime('+1 day', REQUEST_TIME)),
     );
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
-    $this->assertRaw(t("The 'unpublish on' date must be later than the 'publish on' date."), 'Validation prevents entering an unpublish-on date which is earlier than the publish-on date.');
+    $this->assertText("The 'unpublish on' date must be later than the 'publish on' date.", 'Validation prevents entering an unpublish-on date which is earlier than the publish-on date.');
 
   }
 
-
-
   /**
    * Tests the deletion of a scheduled node.
-   *
    */
   public function testScheduledNodeDelete() {
     // Log in.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // 1. Test if it is possible to delete a node that does not have a
     // publication date set, when scheduled publishing is required, and likewise
     // for unpublishing.
     // @see https://drupal.org/node/1614880
-
     // Create a published and an unpublished node, both without scheduling.
     $published_node = $this->drupalCreateNode(array('type' => 'page', 'status' => 1));
     $unpublished_node = $this->drupalCreateNode(array('type' => 'page', 'status' => 0));
@@ -621,34 +618,44 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     // It is also good when testing for the absense of something to also test
     // for the presence of text, hence the second assertion for each check.
     $this->drupalPost('node/' . $published_node->nid . '/edit', array(), t('Delete'));
-    $this->assertNoRaw(t('Error message'), 'No error messages are shown when trying to delete a published node with no scheduling information.');
-    $this->assertRaw(t('Are you sure you want to delete'), 'The deletion warning message is shown immediately when trying to delete a published node with no scheduling information.');
+    $this->assertNoText('Error message', 'No error messages are shown when trying to delete a published node with no scheduling information.');
+    $this->assertText('Are you sure you want to delete', 'The deletion warning message is shown immediately when trying to delete a published node with no scheduling information.');
 
     $this->drupalPost('node/' . $unpublished_node->nid . '/edit', array(), t('Delete'));
-    $this->assertNoRaw(t('Error message'), 'No error messages are shown when trying to delete an unpublished node with no scheduling information.');
-    $this->assertRaw(t('Are you sure you want to delete'), 'The deletion warning message is shown immediately when trying to delete an unpublished node with no scheduling information.');
+    $this->assertNoText('Error message', 'No error messages are shown when trying to delete an unpublished node with no scheduling information.');
+    $this->assertText('Are you sure you want to delete', 'The deletion warning message is shown immediately when trying to delete an unpublished node with no scheduling information.');
 
     // 2. Test that nodes can be deleted with no validation errors if the
     // dates are in the past.
     // @see http://drupal.org/node/2627370
-
     // Turn off required publishing and unpublishing.
     variable_set('scheduler_publish_required_page', FALSE);
     variable_set('scheduler_unpublish_required_page', FALSE);
 
     // Create nodes with publish_on and unpublish_on dates in the past.
-    $published_node = $this->drupalCreateNode(array('type' => 'page', 'status' => 1, 'unpublish_on' => strtotime('- 2 day', REQUEST_TIME)));
-    $unpublished_node = $this->drupalCreateNode(array('type' => 'page', 'status' => 0, 'publish_on' => strtotime('- 2 day', REQUEST_TIME)));
+    $values = array(
+      'type' => 'page',
+      'status' => TRUE,
+      'unpublish_on' => strtotime('- 2 day', REQUEST_TIME),
+    );
+    $published_node = $this->drupalCreateNode($values);
+
+    $values = array(
+      'type' => 'page',
+      'status' => FALSE,
+      'publish_on' => strtotime('- 2 day', REQUEST_TIME),
+    );
+    $published_node = $this->drupalCreateNode($values);
 
     // Attempt to delete the published node and check for no validation error.
     $this->drupalPost('node/' . $published_node->nid . '/edit', array(), t('Delete'));
-    $this->assertNoRaw(t('Error message'), 'No error messages are shown when trying to delete a node with an unpublish date in the past.');
-    $this->assertRaw(t('Are you sure you want to delete'), 'The deletion warning message is shown immediately when trying to delete a node with an unpublish date in the past.');
+    $this->assertNoText('Error message', 'No error messages are shown when trying to delete a node with an unpublish date in the past.');
+    $this->assertText('Are you sure you want to delete', 'The deletion warning message is shown immediately when trying to delete a node with an unpublish date in the past.');
 
     // Attempt to delete the unpublished node and check for no validation error.
     $this->drupalPost('node/' . $unpublished_node->nid . '/edit', array(), t('Delete'));
-    $this->assertNoRaw(t('Error message'), 'No error messages are shown when trying to delete a node with a publish date in the past.');
-    $this->assertRaw(t('Are you sure you want to delete'), 'The deletion warning message is shown immediately when trying to delete a node with a publish date in the past.');
+    $this->assertNoText('Error message', 'No error messages are shown when trying to delete a node with a publish date in the past.');
+    $this->assertText('Are you sure you want to delete', 'The deletion warning message is shown immediately when trying to delete a node with a publish date in the past.');
 
   }
 
@@ -661,7 +668,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
    */
   public function testMetaInformation() {
     // Log in.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Create a published node without scheduling.
     $published_node = $this->drupalCreateNode(array('type' => 'page', 'status' => 1));
@@ -700,8 +707,8 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     ));
     $this->drupalLogin($this->webUser);
 
-    // Set the defaults for a new node. Nothing in array means all OFF.
-    // 'status', 'promote', 'sticky'
+    // Set the defaults for a new node. Nothing in array means all OFF for
+    // 'status', 'promote' and 'sticky'.
     variable_set('node_options_page', array());
 
     // Check that neither of the fields are displayed when creating a node.
@@ -716,14 +723,17 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     // Check that a new node can be saved and published.
     $title = $this->randomString(15);
     $this->drupalPost('node/add/page', array('title' => $title, 'status' => TRUE), t('Save'));
-    $this->assertRaw(t('@type %title has been created.', array('@type' => 'Basic page', '%title' => $title)), 'A node can be created and published when the user does not have scheduler permissions, and scheduling is not required.');
+    // check_plain() is required because the title may have % & or ' in it.
+    // Could use randomName() to get round this instead but it is good to use
+    // the full variety of characters available in randomString.
+    $this->assertText(sprintf('%s %s has been created.', 'Basic page', check_plain($title)), 'A node can be created and published when the user does not have scheduler permissions, and scheduling is not required.');
     $node = $this->drupalGetNodeByTitle($title);
     $this->assertTrue($node->status, 'The new node is published.');
 
     // Check that a new node can be saved as unpublished.
     $title = $this->randomString(15);
     $this->drupalPost('node/add/page', array('title' => $title, 'status' => FALSE), t('Save'));
-    $this->assertRaw(t('@type %title has been created.', array('@type' => 'Basic page', '%title' => $title)), 'A node can be created and saved as unpublished when the user does not have scheduler permissions, and scheduling is not required.');
+    $this->assertText(sprintf('%s %s has been created.', 'Basic page', check_plain($title)), 'A node can be created and saved as unpublished when the user does not have scheduler permissions, and scheduling is not required.');
     $node = $this->drupalGetNodeByTitle($title);
     $this->assertFalse($node->status, 'The new node is unpublished.');
 
@@ -734,7 +744,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     // @TODO Add tests when scheduled publishing and unpublishing are required.
     // Cannot be done until we make a decision on what 'required'  means.
     // @see https://www.drupal.org/node/2707411
-    // "Conflict between 'required publishing' and not having scheduler permission"
+    // "Conflict between 'required publishing' and not having permission"
   }
 
   /**
@@ -742,7 +752,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
    */
   public function testTokenReplacement() {
     // Log in.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Define timestamps for consistent use when repeated throughout this test.
     $publish_on_timestamp = REQUEST_TIME + 3600;
@@ -761,10 +771,26 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
 
     // Create array of test case data.
     $test_cases = array(
-      array('token_format' => '', 'date_format' => 'medium', 'custom' => ''),
-      array('token_format' => ':long', 'date_format' => 'long', 'custom' => ''),
-      array('token_format' => ':raw', 'date_format' => 'custom', 'custom' => 'U'),
-      array('token_format' => ':custom:jS F g:ia e O', 'date_format' => 'custom', 'custom' => 'jS F g:ia e O'),
+      array(
+        'token_format' => '',
+        'date_format' => 'medium',
+        'custom' => '',
+      ),
+      array(
+        'token_format' => ':long',
+        'date_format' => 'long',
+        'custom' => '',
+      ),
+      array(
+        'token_format' => ':raw',
+        'date_format' => 'custom',
+        'custom' => 'U',
+      ),
+      array(
+        'token_format' => ':custom:jS F g:ia e O',
+        'date_format' => 'custom',
+        'custom' => 'jS F g:ia e O',
+      ),
     );
 
     $langcode = LANGUAGE_NONE;
@@ -844,7 +870,7 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
   /**
    * Test scheduler lightweight cron runs.
    */
-  function testLightweightCronRun() {
+  public function testLightweightCronRun() {
     // Run the lightweight cron anonymously without any cron key.
     $this->drupalGet('scheduler/cron');
     $this->assertResponse(200, 'With no cron key (default) scheduler/cron returns "200 OK"');
@@ -852,7 +878,6 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
     // Generate and set a cron key.
     $cron_key = substr(md5(rand()), 0, 20);
     variable_set('scheduler_lightweight_access_key', $cron_key);
-    debug($cron_key, '$cron_key');
 
     // Run the lightweight cron without any cron key.
     $this->drupalGet('scheduler/cron');
@@ -870,9 +895,10 @@ class SchedulerFunctionalTest extends SchedulerTestBase {
 }
 
 /**
- * Tests the components of the scheduler interface which use the date module
+ * Tests the components of the scheduler interface which use the date module.
  */
 class SchedulerDateCombinedFunctionalTest extends SchedulerTestBase {
+
   /**
    * {@inheritdoc}
    */
@@ -887,86 +913,80 @@ class SchedulerDateCombinedFunctionalTest extends SchedulerTestBase {
   /**
    * {@inheritdoc}
    */
-  function setUp() {
+  public function setUp() {
     parent::setUp('date', 'date_popup', 'scheduler');
     parent::commonSettings();
   }
 
   /**
-   * Asserts that the default time works as expected.
-   */
-  protected function assertDefaultTime() {
-    // Define the form fields and date formats we will test according to whether
-    // date popups have been enabled or not.
-    $using_popup = variable_get('scheduler_field_type', 'date_popup') == 'date_popup';
-    $publish_date_field = $using_popup ? 'publish_on[date]' : 'publish_on';
-    $unpublish_date_field = $using_popup ? 'unpublish_on[date]' : 'unpublish_on';
-    $publish_time_field = $using_popup ? 'publish_on[time]' : 'publish_on';
-    $unpublish_time_field = $using_popup ? 'unpublish_on[time]' : 'unpublish_on';
-    $time_format = $using_popup ? 'H:i:s' : 'Y-m-d H:i:s';
-
-    // We cannot easily test the exact validation messages as they contain the
-    // REQUEST_TIME of the POST request, which can be one or more seconds in the
-    // past. Best we can do is check the fixed part of the message as it is when
-    // passed to t(). This will only work in English.
-    $publish_validation_message = $using_popup ? t('The value input for field %field is invalid:', array('%field' => 'Publish on')) : "The 'publish on' value does not match the expected format of";
-    $unpublish_validation_message = $using_popup ? t('The value input for field %field is invalid:', array('%field' => 'Unpublish on')) : "The 'unpublish on' value does not match the expected format of";
-
-    // First test with the "date only" functionality disabled.
-    $this->drupalPost('admin/config/content/scheduler', array('scheduler_allow_date_only' => FALSE), t('Save configuration'));
-
-    // Test if entering a time is required.
-    $edit = array(
-      'title' => $this->randomName(),
-      $publish_date_field => date('Y-m-d', strtotime('+1 day', REQUEST_TIME)),
-      $unpublish_date_field => date('Y-m-d', strtotime('+2 day', REQUEST_TIME)),
-    );
-    $this->drupalPost('node/add/page', $edit, t('Save'));
-
-    $this->assertRaw($publish_validation_message, 'By default it is required to enter a time when scheduling content for publication.');
-    $this->assertRaw($unpublish_validation_message, 'By default it is required to enter a time when scheduling content for unpublication.');
-
-    // Allow the user to enter only the date and repeat the test.
-    $this->drupalPost('admin/config/content/scheduler', array('scheduler_allow_date_only' => TRUE), t('Save configuration'));
-
-    $this->drupalPost('node/add/page', $edit, t('Save'));
-    $this->assertNoRaw("The 'publish on' value does not match the expected format of", 'If the default time option is enabled the user can skip the time when scheduling content for publication.');
-    $this->assertNoRaw("The 'unpublish on' value does not match the expected format of", 'If the default time option is enabled the user can skip the time when scheduling content for unpublication.');
-    $this->assertRaw(t('This post is unpublished and will be published @publish_time.', array('@publish_time' => date('Y-m-d H:i:s', strtotime('tomorrow', REQUEST_TIME) + 23400))), 'The user is informed that the content will be published on the requested date, on the default time.');
-
-    // Check that the default time has been added to the scheduler form fields.
-    $this->clickLink(t('Edit'));
-    $this->assertFieldByName($publish_time_field, date($time_format, strtotime('tomorrow', REQUEST_TIME) + 23400), 'The default time offset has been added to the date field when scheduling content for publication.');
-    $this->assertFieldByName($unpublish_time_field, date($time_format, strtotime('tomorrow +1 day', REQUEST_TIME) + 23400), 'The default time offset has been added to the date field when scheduling content for unpublication.');
-  }
-
-  /**
    * Test the default time functionality.
    */
   public function testDefaultTime() {
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
+    // Perform the checks twice, first using plain text entry then with date
+    // popup calendars.
     foreach (array('textfield', 'date_popup') as $field_type) {
-      // Check that the correct default time is added to the scheduled date.
+
+      // Define the form fields and date formats we will test according to
+      // whether date calendar popups will be used or not.
+      $using_popup = $field_type == 'date_popup';
+      $publish_date_field = $using_popup ? 'publish_on[date]' : 'publish_on';
+      $unpublish_date_field = $using_popup ? 'unpublish_on[date]' : 'unpublish_on';
+      $publish_time_field = $using_popup ? 'publish_on[time]' : 'publish_on';
+      $unpublish_time_field = $using_popup ? 'unpublish_on[time]' : 'unpublish_on';
+      $time_format = $using_popup ? 'H:i:s' : 'Y-m-d H:i:s';
+
+      // We cannot easily test the exact validation messages as they contain the
+      // REQUEST_TIME of the POST request, which can be one or more seconds in
+      // the past. Best we can do is check the fixed part of the message.
+      $publish_validation_message = $using_popup ? 'The value input for field Publish on is invalid:' : "The 'publish on' value does not match the expected format of";
+      $unpublish_validation_message = $using_popup ? 'The value input for field Unpublish on is invalid:' : "The 'unpublish on' value does not match the expected format of";
+
       // For testing we use an offset of 6 hours 30 minutes (23400 seconds).
-      $edit = array(
+      // First test with the "date only" functionality disabled.
+      $settings = array(
         'scheduler_date_format' => 'Y-m-d H:i:s',
-        'scheduler_allow_date_only' => TRUE,
         'scheduler_default_time' => '6:30',
         'scheduler_field_type' => $field_type,
+        'scheduler_allow_date_only' => FALSE,
       );
-      $this->drupalPost('admin/config/content/scheduler', $edit, t('Save configuration'));
-      $this->assertDefaultTime();
+      $this->drupalPost('admin/config/content/scheduler', $settings, t('Save configuration'));
 
-      // Check that it is not possible to enter a date format without a time if
-      // the 'date only' option is not enabled.
+      // Verify that entering a time is required.
+      $edit = array(
+        'title' => $this->randomName(),
+        $publish_date_field => date('Y-m-d', strtotime('+1 day', REQUEST_TIME)),
+        $unpublish_date_field => date('Y-m-d', strtotime('+2 day', REQUEST_TIME)),
+      );
+      $this->drupalPost('node/add/page', $edit, t('Save'));
+      $this->assertText($publish_validation_message, 'Validation error message is shown correctly. By default it is required to enter a time when scheduling content for publication.');
+      $this->assertText($unpublish_validation_message, 'Validation error message is shown correctly. By default it is required to enter a time when scheduling content for unpublication.');
+
+      // Allow the user to enter only the date.
+      $settings = array('scheduler_allow_date_only' => TRUE);
+      $this->drupalPost('admin/config/content/scheduler', $settings, t('Save configuration'));
+
+      // Check that the correct default time is added to the scheduled date.
+      $this->drupalPost('node/add/page', $edit, t('Save'));
+      $this->assertNoText("The 'publish on' value does not match the expected format of", 'If the default time option is enabled the user can skip the time when scheduling content for publication.');
+      $this->assertNoText("The 'unpublish on' value does not match the expected format of", 'If the default time option is enabled the user can skip the time when scheduling content for unpublication.');
+      $publish_time = date('Y-m-d H:i:s', strtotime('tomorrow', REQUEST_TIME) + 23400);
+      $this->assertText(sprintf('This post is unpublished and will be published %s.', $publish_time), 'The user is informed that the content will be published on the requested date, on the default time.');
+
+      // Check that the default time has been added to the form fields on edit.
+      $this->clickLink(t('Edit'));
+      $this->assertFieldByName($publish_time_field, date($time_format, strtotime('tomorrow', REQUEST_TIME) + 23400), 'The default time offset has been added to the date field when scheduling content for publication.');
+      $this->assertFieldByName($unpublish_time_field, date($time_format, strtotime('tomorrow +1 day', REQUEST_TIME) + 23400), 'The default time offset has been added to the date field when scheduling content for unpublication.');
+
+      // Check that it is not possible for the admin to enter a date format
+      // without a time if the 'date only' option is not enabled.
       $edit = array(
         'scheduler_date_format' => 'Y-m-d',
         'scheduler_allow_date_only' => FALSE,
-        'scheduler_field_type' => $field_type,
       );
       $this->drupalPost('admin/config/content/scheduler', $edit, t('Save configuration'));
-      $this->assertRaw(t('You must either include a time within the date format or enable the date-only option.'), format_string('It is not possible to enter a date format without a time if the "date only" option is not enabled and the field type is set to %field_type.', array('%field_type' => $field_type)));
+      $this->assertText('You must either include a time within the date format or enable the date-only option.', format_string('It is not possible to enter a date format without a time if the "date only" option is not enabled and the field type is set to %field_type.', array('%field_type' => $field_type)));
     }
   }
 
@@ -974,7 +994,7 @@ class SchedulerDateCombinedFunctionalTest extends SchedulerTestBase {
    * Tests configuration of different date formats with the Date Popup field.
    */
   public function testDatePopupFormats() {
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Define some date formats to test.
     $test_cases = array(
@@ -1011,7 +1031,7 @@ class SchedulerDateCombinedFunctionalTest extends SchedulerTestBase {
       );
       $this->drupalPost('admin/config/content/scheduler', $edit, t('Save configuration'));
       $message = format_string('When using date popups the date format %format is @expected', array('%format' => $date_format, '@expected' => $expected_result ? 'allowed' : 'not allowed.'));
-      $assert = $expected_result ? 'assertNoRaw' : 'assertRaw';
+      $assert = $expected_result ? 'assertNoText' : 'assertText';
       $this->$assert('Error message', $message);
     }
   }
@@ -1045,7 +1065,7 @@ class SchedulerRulesTest extends SchedulerTestBase {
     $this->node = $this->drupalCreateNode(array(
       'title' => 'Initial Test Node',
       'type' => 'page',
-      'uid' => $this->admin_user->uid,
+      'uid' => $this->adminUser->uid,
       'status' => TRUE,
     ));
   }
@@ -1054,7 +1074,7 @@ class SchedulerRulesTest extends SchedulerTestBase {
    * Tests four actions which set and remove the Scheduler dates.
    */
   public function testRulesActions() {
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $node = $this->node;
 
     $message1 = 'RULE 1. Set Publish-on date.';
