- $this->assertEquals("foo=&more%5B0%5D=1&more%5B1%5D=2&added=this", $url->query);
- $this->assertEmpty($url->fragment);
- }
+ $this->assertEquals("more%5B0%5D=1&more%5B1%5D=2&added=this", $url->query);
+ $this->assertEmpty($url->fragment);
+ }
+
+ function testMod() {
+ $tmp = new http\Url($this->url);
+ $mod = $tmp->mod(array("query" => "set=1"), http\Url::REPLACE);
+ $this->assertNotEquals($tmp->toArray(), $mod->toArray());
+ $this->assertEquals("set=1", $mod->query);
+ $this->assertEquals("new_fragment", $tmp->mod("#new_fragment")->fragment);
+ }
+
+ function testStrings() {
+ $url = new http\Url($this->url);
+ $this->assertEquals((string) $url, (string) new http\Url((string) $url));
+ }
+
+ function testArrays() {
+ $url = new http\Url($this->url);
+ $url2 = new http\Url($url->toArray());
+ $this->assertEquals($url->toArray(), $url2->toArray());
+ }