X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_uri_for.t;h=3318192d1e683b21cddf1dcdffd81dfbc6efe5be;hb=480d94b5f34577816d44fe05389ca5a085179363;hp=da40bea1cb7ef2b3bcac145cdf13f0b23ccf7c09;hpb=2689f8a4d4914dc316857f50eea2cf03788b7030;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_uri_for.t b/t/aggregate/unit_core_uri_for.t index da40bea..3318192 100644 --- a/t/aggregate/unit_core_uri_for.t +++ b/t/aggregate/unit_core_uri_for.t @@ -8,6 +8,7 @@ use URI; use_ok('TestApp'); my $request = Catalyst::Request->new( { + _log => Catalyst::Log->new, base => URI->new('http://127.0.0.1/foo') } ); my $dispatcher = TestApp->dispatcher; @@ -58,6 +59,15 @@ is( 'Plus is not encoded' ); +TODO: { + local $TODO = 'broken by 5.7008'; + is( + Catalyst::uri_for( $context, '/bar#fragment', { param1 => 'value1' } )->as_string, + 'http://127.0.0.1/foo/bar?param1=value1#fragment', + 'URI for path with fragment and query params' + ); +} + # test with utf-8 is( Catalyst::uri_for( $context, 'quux', { param1 => "\x{2620}" } )->as_string, @@ -159,6 +169,28 @@ TODO: { ); } +{ + my $index_not_private = $dispatcher->get_action_by_path( + '/action/chained/argsorder/index' + ); -done_testing; + is( + Catalyst::uri_for( $context, $index_not_private )->as_string, + 'http://127.0.0.1/argsorder', + 'Return non-DispatchType::Index path for index action with args' + ); +} + +{ + package MyStringThing; + + use overload '""' => sub { $_[0]->{string} }, fallback => 1; +} +is( + Catalyst::uri_for( $context, bless( { string => 'test' }, 'MyStringThing' ) ), + 'http://127.0.0.1/test', + 'overloaded object handled correctly' +); + +done_testing;