Running test from http://drupal.org/node/395012 (I downloaded mymodule.drupal7.tgz) against Drupal 7 HEAD gave me this error:
Running SimpleTests
An error has occurred.
Please continue to the error page
An error occurred.
Path: drupal/batch?id=4&op=do
Message:
Fatal error: Unsupported operand types in D:\www\drupal\modules\simpletest\drupal_web_test_case.php on line 733
I took a look at node.test and it turns out we need language as array key in Drupal 7. For example in create testMymoduleCreate what was:
$edit = array(
'title' => $this->randomName(32),
'body[0][value]' => $this->randomName(64),
);
should be something like:
$langcode = FIELD_LANGUAGE_NONE;
$edit = array(
'title' => $this->randomName(32),
"body[$langcode][0][value]" => $this->randomName(64),
);
After this change test went trough as it should.
Miki
Comments
Comment #1
leehunter commentedtag
Comment #2
arianek commentedHi mikispeed - this isn't really a documentation issue, but an issue with the simpletest code - can you re-post this on the main Drupal issue queue and mark the component as "simpletest.module" so that the module maintainers see it? Thanks.
Comment #3
leehunter commentedremoving d7docs tag
Comment #4
puregin commentedThis looks like a change in API between Drupal 6 and 7. I've split the tutorial into two version - one for Drupal 6 and one for Drupal 7. Let's check the examples and update the appropriate pages.
Comment #5
arianek commentedadding tags
Comment #6
jhodgdonComment #7
quietone commentedD7 is End of Life.