Download & Extend

Exception thrown on entity_create

Project:SimpleTest
Version:7.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I'm trying to write a simple test that I am creating custom entities ok (eventually more interesting things will happen there). here's the function that does that:

function thcommons_entity_container_create($container = array()) {
  global $user;
  $container = array(
    'uid' => $user->uid,
    'ref_entity_machine_name' => 'thcommons_clearinghouse_item',
    'ref_entity_id' => 1
  );
  $entity = entity_create('thcommons_entity_container', $container);

  if($entity) {
    entity_get_controller('thcommons_entity_container')->save($entity);
    return $entity;
  } 
  return FALSE;
}

When the code runs on a basic page with php input filter, everything works fine. When the same function runs in the testing environment, I get this exception:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_thc.simpletest905648node_type' doesn't exist: SELECT nt.* FROM {node_type} nt WHERE (disabled = :db_condition_placeholder_0) ORDER BY nt.type ASC; Array ( [:db_condition_placeholder_0] => 0 ) in _node_types_build() (line 706 of /var/www/d7/modules/node/node.module).

Is there something I'm missing about how to use Simpletest, or is this a bug?

Many thanks,
Patrick

Comments

#1

Status:active» postponed (maintainer needs more info)

Case you pastebin your entire test class?

nobody click here