/** * @test * @depends URI\GenerateTest::Reset */ public function Query_Rename() { // Test both when there is and isn't pre-existing data $uri1 = new \uri('example.com'); $uri2 = new \uri('https://*****:*****@example.com:777/path/to/script.php?query=str#fragment'); $uri3 = new \uri('google.com?empty'); // Check For Errors $this->assertEmpty($uri1->error); $this->assertEmpty($uri2->error); $this->assertFalse($uri1->query_rename('a', 'b')); $this->assertEquals($uri1->input, $uri1->str()); $this->assertTrue($uri2->query_rename('query', 'test')); $this->assertEquals('https://*****:*****@example.com:777/path/to/script.php?test=str#fragment', $uri2->str()); $this->assertTrue($uri3->query_rename('empty', 'none')); $this->assertEquals('google.com?none=', $uri3->str()); }