Beispiel #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;
 }
Beispiel #2
0
 /**
  * Check exception when try to build an invalid URL (after a bad set)
  * @expectedException \Bee4\Transport\Exception\RuntimeException
  */
 public function testInvalidToString()
 {
     $url = new Url('http://www.bee4.fr');
     $url->host('');
     $url->toString();
 }