Hi..
I'm currently doing simpletest cases for the services modules. I realized that json_server need some love also, so I've started to write a testcase for it.
After a DrupalGet request, The following assert is not working:
$this->assertEqual($response['#data'], 'JSON server accepts POST requests only.', 'JSON server accepts POST requests only.');
Doing a isset($_POST) does not work, and $_SERVER['REQUEST_METHOD'] should be used, after that change the test does not fail.
The patch includes the simpletest file.
Note: due to json_decode creating an stdClass with the content, I would suggest removing the '#' character in #error and #data responses. There's no way to get the $content->#error element after doing json_decode on return from server, and should be casted as array.
Comment | File | Size | Author |
---|---|---|---|
#1 | 610364_json_server_post_only.patch | 2.63 KB | ilo |
Comments
Comment #1
ilo CreditAttribution: ilo commentedComment #2
jdwfly CreditAttribution: jdwfly commented+1