public function testConstructorCanBeCalledWithParams() { $testData = array('test' => 'value', 'test_2' => 'value2'); $this->coll = new Collection($testData); $this->assertEquals($this->coll->getAll(), $testData, '-> getAll() must return the data passed in the constructor'); $this->assertEquals($this->coll->getAll(), $this->coll->toArray()); }
/** * @param Collection $headers * @return array */ private function headerCollectionToArray(Collection $headers) { $headers_arr = array(); foreach ($headers->toArray() as $name => $val) { $headers_arr[$name] = current($val); } return $headers_arr; }
private function fireOffPostRequest($action, Collection $params, array $options = []) { $response = $this->client->post($action, ['Content-Type' => 'application/json'], json_encode($params->toArray()), $options)->send(); return $this->responseFactory->buildFromResponse($response); }