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

leehunter’s picture

Issue tags: +d7docs

tag

arianek’s picture

Hi 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.

leehunter’s picture

Issue tags: -d7docs

removing d7docs tag

puregin’s picture

This 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.

arianek’s picture

Issue tags: +Simpletest, +testing

adding tags

jhodgdon’s picture

Component: Other documentation issues » Correction/Clarification
Issue summary: View changes
quietone’s picture

Status: Active » Closed (outdated)

D7 is End of Life.