/** * @param string $string * @param string $protocol * @param string $host * @param int $port * @param string $path * * #@dataProvider providerAddressToString */ public function testParse($string, $protocol, $host, $port, $path) { $address = Address::parse($string); $this->assertEquals($protocol, $address->protocol); $this->assertEquals($host, $address->host); $this->assertEquals($port, $address->port); $this->assertEquals($path, $address->path); }
/** * @param string $address * @param string $version * * @throws InvalidAddressException * @throws InvalidVersionException */ public function __construct($address, $version = self::VERSION_1) { $this->address = Address::parse($address); $this->connectionType = $this->getConnectionType($this->address->protocol); $this->version = $this->verifyVersion($version); }