commit b10dc621ac5dc391af6b7506bd2c2b9dc53c5255 Author: fago Date: Sun Nov 11 15:30:23 2012 +0100 Fixed test fails. diff --git a/core/lib/Drupal/Core/Entity/EntityNG.php b/core/lib/Drupal/Core/Entity/EntityNG.php index 4b9f10f..b56f5c0 100644 --- a/core/lib/Drupal/Core/Entity/EntityNG.php +++ b/core/lib/Drupal/Core/Entity/EntityNG.php @@ -88,6 +88,9 @@ public function __construct(array $values, $entity_type, $bundle = FALSE) { * Initialize the object. Invoked upon construction and wake up. */ protected function init() { + if (!isset(static::$fieldDefinitions)) { + static::$fieldDefinitions = &drupal_static(__CLASS__ . __FUNCTION__); + } if (!isset(static::$fieldDefinitions[$this->entityType][$this->bundle])) { $definitions = entity_get_controller($this->entityType)->getFieldDefinitions(array( 'entity type' => $this->entityType, diff --git a/core/modules/views/lib/Drupal/views/Tests/Comment/DefaultViewRecentComments.php b/core/modules/views/lib/Drupal/views/Tests/Comment/DefaultViewRecentComments.php index 67aefe5..debd1a8 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Comment/DefaultViewRecentComments.php +++ b/core/modules/views/lib/Drupal/views/Tests/Comment/DefaultViewRecentComments.php @@ -77,11 +77,10 @@ public function setUp() { // Create some comments and attach them to the created node. for ($i = 0; $i < $this->masterDisplayResults; $i++) { - $comment = entity_create('comment', array()); + $comment = entity_create('comment', array('node_type' => 'comment_node_' . $this->node->type)); $comment->uid->value = 0; $comment->nid->value = $this->node->nid; $comment->subject->value = 'Test comment ' . $i; - $comment->node_type->value = 'comment_node_' . $this->node->type; $comment->comment_body->value = 'Test body ' . $i; $comment->comment_body->format = 'full_html';