summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuriy Gerasimov2013-06-19 19:40:29 (GMT)
committer Yuriy Gerasimov2013-06-19 19:40:29 (GMT)
commit0ee42794b70482ad26fe8bf7b73555ca8257c6a0 (patch)
tree530de9c25e930e9f82d006d4e4a208411e614597
parent5389532f34fabf1db39771fa3d5e290fa99c75a3 (diff)
Issue #2020121: Add test for stdClass call.
-rw-r--r--lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php2
-rw-r--r--lib/Drupal/services/Tests/AnnotationResourceExampleTest.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php b/lib/Drupal/services/Plugin/rest/resource/AnnotationResourceExample.php
index 33784bc..eab6c00 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 6e36500..c982e58 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();