From 23986b65d683b5ec34822de198185b0571634767 Mon Sep 17 00:00:00 2001 From: Christian A. Weber Date: Fri, 18 Aug 2017 17:38:49 +0200 Subject: U(): params can override base args, correctly add fragment to end of url if params are present, add some tests --- tests/it_html.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/it_html.t b/tests/it_html.t index 2dc7be5..538a350 100755 --- a/tests/it_html.t +++ b/tests/it_html.t @@ -189,6 +189,17 @@ is( 'U() with nested arrays' ); +is( + U("/foo.html?bar=qux", array('bar' => "baz")), + '/foo.html?bar=baz', + 'U() args override get params in base url' +); + +is( + U("/foo.html?bar=qux#frag=frog", array('baz' => "gna")), + '/foo.html?bar=qux&baz=gna#frag=frog', + 'U() fragment after params' +); is( U("Jet d'eau"), 'Jet%20d%27eau', @@ -197,7 +208,7 @@ is( is( U('/test.html?foo=bar?qux=gna', array('?q' => '?r')), - '/test.html?foo=bar%3Fqux=gna&%3Fq=%3Fr', + '/test.html?foo=bar%3Fqux%3Dgna&%3Fq=%3Fr', 'U() quoting of ? in args but not base' ); is( -- cgit v1.2.3