public function testCreateListRequest()
 {
     $testList = ['description' => 'test description', 'title' => 'test title'];
     $request = ListRequestFactory::getCreateListRequest($testList);
     $this->assertInstanceOf('GuzzleHttp\\Psr7\\Request', $request);
     $this->assertEquals('POST', $request->getMethod());
     $this->assertEquals('lists', $request->getUri()->getPath());
     $this->assertEquals(['application/json'], $request->getHeader('Content-Type'));
     $this->assertEquals(\GuzzleHttp\Psr7\stream_for(json_encode($testList))->getContents(), $request->getBody()->getContents());
 }
Exemplo n.º 2
0
 /**
  * @param mixed $list
  * @param array $options
  * @return \GuzzleHttp\Promise\PromiseInterface|\Psr\Http\Message\ResponseInterface
  */
 public function create($list, array $options)
 {
     $request = $this->configurator->configure(ListRequestFactory::getCreateListRequest($list), $options);
     return $this->send($request);
 }