/** * @dataProvider invalidPorts */ public function testWithPortRaisesExceptionForInvalidPorts($port) { $uri = new Uri('https://*****:*****@local.example.com:3001/foo?bar=baz#quz'); $this->setExpectedException('InvalidArgumentException', 'Invalid port'); $new = $uri->withPort($port); }
/** * @group 48 */ public function testWithPortReturnsSameInstanceWhenPortDoesNotChange() { $uri = new Uri('http://example.com:8080'); $test = $uri->withPort(8080); $this->assertSame($uri, $test); }