public function withPortAndArg()
 {
     $t = HttpTransport::transportFor(new \peer\URL('test+v2://example.com:443'));
     $this->assertEquals('example.com', $t->host);
     $this->assertEquals(443, $t->port);
     $this->assertEquals('v2', $t->arg);
 }
 public function null_is_passed_if_scheme_has_no_arg()
 {
     $t = HttpTransport::transportFor(new URL('test://example.com:443'));
     $this->assertNull($t->arg);
 }
Esempio n. 3
0
 /**
  * Constructor
  *
  * @param   var $url a string or a peer.URL object
  */
 public function __construct($url)
 {
     $this->url = $url instanceof URL ? $url : new URL($url);
     $this->transport = HttpTransport::transportFor($this->url);
 }