Exemplo n.º 1
0
 /**
  * Create the request object
  * @param string $method
  * @param string $url
  * @param array $headers
  * @return AbstractRequest
  */
 public function createRequest($method, $url = '', array $headers = [])
 {
     if (!is_string($url)) {
         throw new InvalidArgumentException('Url parameter must be a valid string!!');
     }
     $url = new Url((isset($this->baseUrl) ? $this->baseUrl->toString() : '') . $url);
     $request = $this->requestFactory->build($method, $url, $headers);
     $request->setClient($this);
     return $request;
 }
Exemplo n.º 2
0
 /**
  * @expectedException \Bee4\Transport\Exception\InvalidArgumentException
  */
 public function testInvalidRequestBuild()
 {
     $object = new RequestFactory();
     $object->build('UNKNOWN', new Url('http://www.bee4.fr'), []);
 }