Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.37
diff -u -p -r1.37 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	6 Sep 2008 08:36:20 -0000	1.37
+++ modules/simpletest/drupal_web_test_case.php	6 Sep 2008 23:22:46 -0000
@@ -72,13 +72,13 @@ class DrupalWebTestCase {
     $db_prefix = $this->db_prefix_original;
     db_insert('simpletest')->fields(array(
       'test_id' => $this->test_id,
-    'test_class' => get_class($this), 
-    'status' => $status, 
-    'message' => substr($message, 0, 255),  // Some messages are too long for the database.
-    'message_group' => $group, 
-    'caller' => $function['function'], 
-    'line' => $function['line'], 
-    'file' => $function['file'],
+      'test_class' => get_class($this),
+      'status' => $status,
+      'message' => substr($message, 0, 255),  // Some messages are too long for the database.
+      'message_group' => $group,
+      'caller' => $function['function'],
+      'line' => $function['line'],
+      'file' => $function['file'],
     ))->execute();
     $this->_assertions[] = array(
       'status' => $status,
@@ -405,7 +405,7 @@ class DrupalWebTestCase {
     node_types_rebuild();
 
     $this->assertEqual($saved_type, SAVED_NEW, t('Created content type %type.', array('%type' => $type->type)));
-    
+
     // Reset permissions so that permissions for this content type are available.
     $this->checkPermissions(array(), TRUE);
 
@@ -645,7 +645,7 @@ class DrupalWebTestCase {
 
     // Generate temporary prefixed database to ensure that tests have a clean starting point.
     $db_prefix = 'simpletest' . mt_rand(1000, 1000000);
-    
+
     include_once './includes/install.inc';
     drupal_install_system();
 
@@ -659,7 +659,7 @@ class DrupalWebTestCase {
     // stale data for the previous run's database prefix and all
     // calls to it will fail.
     drupal_get_schema(NULL, TRUE);
-    
+
     // Run default profile tasks.
     $task = 'profile';
     default_profile_tasks($task, '');
@@ -898,7 +898,9 @@ class DrupalWebTestCase {
             // is broken. This is a less than elegant workaround. Alternatives
             // are being explored at #253506.
             foreach ($upload as $key => $file) {
-              $post[$key] = '@' . realpath($file);
+              if ($file = realpath($file) && is_file($file)) {
+                $post[$key] = '@' . $file;
+              }
             }
           }
           else {
