示例#1
0
 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());
 }
示例#2
0
 /**
  * @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;
 }
示例#3
0
 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);
 }