When executing the following code:

                $edit = array();
                $edit['os_poker_8[region]'] = 'content';
                $this->drupalPost('admin/build/block', $edit, t('Save blocks'));

drupalPost report a failure in "Test result", even thought the POST didn't fail.

Because this->content is empty after handling a 302 redirect in curlExec:

    $this->assertTrue($this->content !== FALSE, $message, t('Browser'));

Let me know if you need more information.

Comments

proppy’s picture

A tentative workraround:

diff -r 94a13b44993d usr/src/simpletest/drupal_web_test_case.php
--- a/usr/src/simpletest/drupal_web_test_case.php       Fri Nov 27 10:20:40 2009 +0100
+++ b/usr/src/simpletest/drupal_web_test_case.php       Fri Nov 27 10:21:07 2009 +0100
@@ -1365,7 +1365,7 @@
       '!length' => format_size(strlen($this->content))
     );
     $message = t('!method @url returned @status (!length).', $message_vars);
-    $this->assertTrue($this->content !== FALSE, $message, t('Browser'));
+    $this->assertTrue(($this->content !== FALSE) || ($message_vars['@status'] == 302), $message, t('Browser'));
     return $this->drupalGetContent();
   }

boombatower’s picture

I need to look into confirming this, but curl should be dealing with 302's and it should never get to php.

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

tests/block.test works fine and has similar code as does half of the d7 core tests that this framework is a direct backport of. Please check to see if something else more interesting is at work, possibly something odd with curl, I'm not sure what else to say.

boombatower’s picture

Version: 6.x-2.9 » 6.x-2.x-dev
Assigned: Unassigned » boombatower
Status: Postponed (maintainer needs more info) » Fixed

Please re-open if still occurs.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.