? clock-tests.patch
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/CHANGELOG.txt,v
retrieving revision 1.12
diff -u -p -r1.12 CHANGELOG.txt
--- CHANGELOG.txt	7 Oct 2010 17:27:13 -0000	1.12
+++ CHANGELOG.txt	7 Oct 2010 18:47:42 -0000
@@ -1,7 +1,8 @@
-// $Id: CHANGELOG.txt,v 1.12 2010/10/07 17:27:13 tstoeckler Exp $
+// $Id: CHANGELOG.txt,v 1.7.2.5 2010/10/07 18:46:29 tstoeckler Exp $
 
 Clock 7.x-1.x-dev
 ----------------------
+- #934980: Fix tests and use testing profile.
 - #853000: General clean-up, remove t() from test file, refactor to only use
            three variables, consistent variable naming.
 - #706602: Initial port to Drupal 7.
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/README.txt,v
retrieving revision 1.4
diff -u -p -r1.4 README.txt
--- README.txt	21 Sep 2010 22:23:24 -0000	1.4
+++ README.txt	7 Oct 2010 18:47:42 -0000
@@ -1,4 +1,4 @@
-; $Id: README.txt,v 1.4 2010/09/21 22:23:24 tstoeckler Exp $
+; $Id: README.txt,v 1.1.4.6 2010/10/07 18:46:29 tstoeckler Exp $
 
 /**
  * Installation
Index: clock.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/clock.info,v
retrieving revision 1.9
diff -u -p -r1.9 clock.info
--- clock.info	21 Sep 2010 22:23:24 -0000	1.9
+++ clock.info	7 Oct 2010 18:47:42 -0000
@@ -1,4 +1,4 @@
-; $Id: clock.info,v 1.9 2010/09/21 22:23:24 tstoeckler Exp $
+; $Id: clock.info,v 1.5.2.4 2010/10/07 18:46:30 tstoeckler Exp $
 name = Clock
 description = Provides a block displaying the current time.
 core = 7.x
Index: clock.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/clock.install,v
retrieving revision 1.8
diff -u -p -r1.8 clock.install
--- clock.install	27 Jul 2010 20:41:23 -0000	1.8
+++ clock.install	7 Oct 2010 18:47:42 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: clock.install,v 1.8 2010/07/27 20:41:23 tstoeckler Exp $
+// $Id: clock.install,v 1.5.2.4 2010/10/07 18:46:30 tstoeckler Exp $
 
 /**
  * @file
Index: clock.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/clock.js,v
retrieving revision 1.16
diff -u -p -r1.16 clock.js
--- clock.js	21 Sep 2010 22:23:24 -0000	1.16
+++ clock.js	7 Oct 2010 18:47:42 -0000
@@ -1,4 +1,4 @@
-// $Id: clock.js,v 1.16 2010/09/21 22:23:24 tstoeckler Exp $
+// $Id: clock.js,v 1.10.2.7 2010/10/07 18:46:30 tstoeckler Exp $
 (function ($) {
 
 /**
Index: clock.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/clock.module,v
retrieving revision 1.19
diff -u -p -r1.19 clock.module
--- clock.module	7 Oct 2010 02:14:57 -0000	1.19
+++ clock.module	7 Oct 2010 18:47:42 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: clock.module,v 1.19 2010/10/07 02:14:57 tstoeckler Exp $
+// $Id: clock.module,v 1.10.2.7 2010/10/07 18:46:30 tstoeckler Exp $
 
 /**
 * Implements hook_help().
@@ -63,7 +63,7 @@ function clock_block_configure($delta = 
   if ($delta == 'clock') {
 
     // Time zone options.
-    $time_zone = variable_get('clock_time_zone', 1);
+    $time_zone = variable_get('clock_time_zone', 2);
     // If the time zone is not set to the integer values 1, 2 or 3 corresponding
     // to 'Site time zone', 'User time zone' and 'Local time zone' it contains
     // the name of a custom time zone, so the time zone type must be set to
@@ -177,7 +177,7 @@ function clock_block_view($delta = '') {
  *   'Local' if the user's local time is to be used.
  */
 function _clock_get_timezone() {
-  $time_zone = variable_get('clock_time_zone', 1);
+  $time_zone = variable_get('clock_time_zone', 2);
   switch ($time_zone) {
     // Site time zone.
     case 1:
@@ -218,7 +218,7 @@ function clock_theme() {
   return array(
     'clock' => array(
       'variables' => array(
-        'time_zone' => 'UTC',
+        'time_zone' => 'NULL',
         'date_format' => '',
         'update' => 1,
       ),
Index: clock.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/clock/clock.test,v
retrieving revision 1.8
diff -u -p -r1.8 clock.test
--- clock.test	27 Jul 2010 15:53:59 -0000	1.8
+++ clock.test	7 Oct 2010 18:47:42 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: clock.test,v 1.8 2010/07/27 15:53:59 tstoeckler Exp $
+// $Id: clock.test,v 1.5.2.4 2010/10/07 18:46:30 tstoeckler Exp $
 
 /**
  * @file
@@ -7,6 +7,7 @@
  */
 
 class ClockBlockTestCase extends DrupalWebTestCase {
+  protected $profile = 'testing';
 
   public static function getInfo() {
     return array(
@@ -22,10 +23,12 @@ class ClockBlockTestCase extends DrupalW
     // Save the test user's uid to access the user edit page later.
     variable_set('test_user_id', $privileged_user->uid);
     $this->drupalLogin($privileged_user);
-    // Enable the clock block in main content area in the Seven theme.
+    // Enable the clock block (and the main content block) in main content area.
+    $theme = variable_get('theme_default', '');
     $edit = array();
-    $edit['clock_clock[region]'] = 'content';
-    $this->drupalPost('admin/structure/block/list/seven', $edit, 'Save blocks');
+    $edit['blocks[clock_clock][region]'] = 'content';
+    $edit['blocks[system_main][region]'] = 'content';
+    $this->drupalPost("admin/structure/block/list/$theme", $edit, 'Save blocks');
   }
 
   public function testClockBlock() {
@@ -33,7 +36,7 @@ class ClockBlockTestCase extends DrupalW
     global $language;
 
     // Test the default display of the clock.
-    $clock = date_format_date(date_now(variable_get('date_default_timezone', NULL)), 'long');
+    $clock = date_format_date(date_now(variable_get('date_default_timezone', 'UTC')), 'long');
     $this->assertText($clock, 'Ensure that the clock is correctly displayed by default.');
     $edit = array();
     $edit['time_zone_type'] = 3;
@@ -58,7 +61,7 @@ class ClockBlockTestCase extends DrupalW
     $edit['time_zone_type'] = 4;
     $edit['time_zone_custom'] = 'Africa/Lubumbashi';
     $this->drupalPost('admin/structure/block/manage/clock/clock/configure', $edit, 'Save block');
-    $clock = date_format_date(date_now('Africa/Timbuktu'), 'long');
+    $clock = date_format_date(date_now('Africa/Lubumbashi'), 'long');
     $this->assertText($clock, 'Ensure that the clock is correctly displayed in a custom date format');
 
     // Create a custom date type.
@@ -77,6 +80,7 @@ class ClockBlockTestCase extends DrupalW
       'locked' => FALSE,
     ));
     // Make the date format the default for the new date type.
+    include_once DRUPAL_ROOT . '/includes/locale.inc';
     locale_date_format_save($language->language, $date_type, $date_format);
     // Test all date types (including the custom one).
     foreach (system_get_date_types() as $type => $info) {
