diff --git a/lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php b/lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php index 33784bc15d81b79af6c5c6c0984e5583f046d3ec..eab6c00ce7befcf861f244048e63efea327a2b14 100644 --- a/lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php +++ b/lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php @@ -85,6 +85,6 @@ class AnnotationResourceExample extends AnnotationResourceBase { * ) */ public function examplePostCall() { - return new ResourceResponse(array('message' => 'POST call')); + return new ResourceResponse(array('message' => (object) array('POST call'))); } } \ No newline at end of file diff --git a/lib/Drupal/services/Tests/AnnotationResourceExampleTest.php b/lib/Drupal/services/Tests/AnnotationResourceExampleTest.php index 6e36500b7b8852a59a07f04c901adfc780a1ed5f..c982e5805bc14dbd792be30989e24712be8297ca 100644 --- a/lib/Drupal/services/Tests/AnnotationResourceExampleTest.php +++ b/lib/Drupal/services/Tests/AnnotationResourceExampleTest.php @@ -47,7 +47,7 @@ class AnnotationResourceExampleTest extends RESTTestBase { $response = $this->httpRequest('examplePostCall', 'POST', NULL, $this->defaultMimeType); $decoded_response = drupal_json_decode($response); - $decoded_expected = array('message' => 'POST call'); + $decoded_expected = array('message' => array('POST call')); $this->assertIdentical($decoded_expected, $decoded_response, 'examplePostCall response expected'); $arg1 = $this->randomName();