I got an error when simpletest clone:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=18&op=do StatusText: Internal Server Error ResponseText:

In result page I can see:

The test did not complete due to a fatal error. Completion check dd2012_users.test 26 DDUsersTestCase->testDDUserRegister()

Argument 2 passed to db_query() must be an array, string given, called in /var/vhosts/dd2012/sites/all/modules/simpletest_clone/simpletest_clone_test_case.php on line 142 and defined Recoverable error database.inc 2313 db_query()

Argument 3 passed to db_query() must be an array, string given, called in /var/vhosts/dd2012/sites/all/modules/simpletest_clone/simpletest_clone_test_case.php on line 142 and defined Recoverable error database.inc 2313 db_query()

Argument 2 passed to DatabaseConnection::query() must be an array, string given, called in /var/vhosts/dd2012/includes/database/database.inc on line 2318 and defined Recoverable error database.inc 648 DatabaseConnection->query()

Unsupported operand types PHP Fatal error database.inc 651 Unknown

This is my test case code:

// Include SimpleTest Clone
module_load_include('test', 'simpletest_clone');


//class DDUsersTestCase extends SimpleTestCloneTestCase {
class DDUsersTestCase extends SimpleTestCloneTestCase {

  public static function getInfo() {
    // Note: getInfo() strings should not be translated.
    return array(
      'name' => 'DD2012',
      'description' => 'Tests for different users test cases.',
      'group' => 'DD2012',
    );
  }


  public function setUp() {
    parent::setUp();
  }

  public function testDDUserRegister() {
    $this->pass('Ok');
  }

}

The error produces when db_query is called to copy data from source table to new created table for test.

Test file is declared in .info module.

If I extend from DrupalWebTestCase there's no error.

I've tested it with a fresh Drupal 7.12 install.

I think it would be strange simpletest_clone has such a bug, so I assume I'm doing something wrong, but I can't figure out what..

Comments

tunic’s picture

Category: feature » support

Oops, changing category...

jhedstrom’s picture

Status: Active » Fixed

Huh, it looks like the port of #946026: Ordering of columns is different for CCK generated tables on cloned tables wasn't quite right. This is fixed now. Thanks!

Status: Fixed » Closed (fixed)

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