diff --git a/restws.test b/restws.test index 4fc0a77..19d14b0 100644 --- a/restws.test +++ b/restws.test @@ -79,7 +79,7 @@ class RestWSTestCase extends DrupalWebTestCase { $this->assertEqual(curl_getinfo($this->curlHandle, CURLINFO_CONTENT_TYPE), 'application/json', 'HTTP content type is correct.'); // Test Create node with multi value field. - $multivaluefield = array($this->randomName(8), $this->randomName(8), $this->randomName(8), $this->randomName(8)); + $multivaluefield = array(array('value' => $this->randomName(8),), array('value' => $this->randomName(8),), array('value' => $this->randomName(8),), array('value' => $this->randomName(8),)); $new_node = array( 'body' => array(LANGUAGE_NONE => array(array())), 'title' => $title, @@ -92,7 +92,8 @@ class RestWSTestCase extends DrupalWebTestCase { $result_array = drupal_json_decode($result); $nid = $result_array['id']; $node2 = node_load($nid); - $this->assertEqual($multivaluefield, $node2->{$this->field_name}, 'Multi-value field from DB is equal to the new multi-value field.'); + $this->assertEqual($multivaluefield[0]['value'], $node2->{$this->field_name}['und'][0]['value'], 'Multi-value field from DB is equal to the new multi-value field. Value 1.'); + $this->assertEqual($multivaluefield[1]['value'], $node2->{$this->field_name}['und'][1]['value'], 'Multi-value field from DB is equal to the new multi-value field. Value 2.'); $this->assertResponse('201', 'HTTP response code is correct.'); $this->assertEqual(curl_getinfo($this->curlHandle, CURLINFO_CONTENT_TYPE), 'application/json', 'HTTP content type is correct.');