public function testHttpPost() { $api = new \CashWay\API(get_conf()); $res1 = $api->httpPost('/path/to/test', json_encode(array('query' => 'value'))); $res = $api->httpPost('/path/to/test', array('query' => 'value')); $this->assertEquals($res1, $res); $this->assertEquals('POST', $res['method']); $this->assertEquals('/1/path/to/test', $res['request']); $this->assertJsonStringEqualsJsonString(json_encode(array('query' => 'value')), $res['body']); $this->assertEquals('200', $api->last_http_code); }