responses = $responses; } public function head($url) { return $this->respond('HEAD', $url); } public function get($url) { return $this->respond('GET', $url); } public function post($url, $body) { return $this->respond('POST', $url, $body); } private function respond($method, $url, $body=null) { $this->requests[] = ['method' => $method, 'url' => $url, 'body' => $body]; $response = isset($this->responses[$method]) ? $this->responses[$method] : []; return array_merge([ 'code' => 200, 'headers' => [], 'rels' => [], 'body' => '', ], $response); } }