[Catalyst-commits] r13545 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst t t/lib/TestApp/Controller
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Thu Aug 26 00:20:16 GMT 2010
Author: t0m
Date: 2010-08-26 01:20:16 +0100 (Thu, 26 Aug 2010)
New Revision: 13545
Modified:
Catalyst-Runtime/5.80/trunk/
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/Makefile.PL
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Test.pm
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Root.pm
Catalyst-Runtime/5.80/trunk/t/live_catalyst_test.t
Log:
r15773 at t0mlaptop (orig r13464): rjk | 2010-08-03 19:23:50 +0100
Create branch Catalyst-Test-base-href
r15775 at t0mlaptop (orig r13466): rjk | 2010-08-03 21:56:42 +0100
Make Catalyst::Test::local_request() set response base from base href (requires HTML::HeadParser)
r15854 at t0mlaptop (orig r13544): t0m | 2010-08-26 01:20:05 +0100
Changelog
Property changes on: Catalyst-Runtime/5.80/trunk
___________________________________________________________________
Modified: svk:merge
- 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/aggregate_more:11803
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/better_scripts:12074
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_iis_cgi:13450
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_path_info_decoding:12089
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_request_uri:13262
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/more_metaclass_compat:13280
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/param_filtering:13012
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/rt58057:13445
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/tweak_controller_action_creation:13440
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_encode_captures_andor_args_take2:11811
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_for_utf8:12834
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-mech_tests:15583
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
+ 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-base-href:13544
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/aggregate_more:11803
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/better_scripts:12074
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_iis_cgi:13450
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_path_info_decoding:12089
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_request_uri:13262
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/more_metaclass_compat:13280
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/param_filtering:13012
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/rt58057:13445
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/tweak_controller_action_creation:13440
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_encode_captures_andor_args_take2:11811
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_for_utf8:12834
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-mech_tests:15583
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
Added: svn:mergeinfo
+
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2010-08-26 00:20:05 UTC (rev 13544)
+++ Catalyst-Runtime/5.80/trunk/Changes 2010-08-26 00:20:16 UTC (rev 13545)
@@ -19,6 +19,10 @@
- Fix show_internal_actions config setting producing warnings in debug
mode (RT#59738)
+ - Make Catalyst::Test::local_request() set the response base from base href
+ in the returned document so that links can be resolved correctly by
+ Test::WWW::Mechanize::Catalyst
+
Refactoring:
- moved component name sort that happens in setup_components to
locate_components to allow methods to wrap around locate_components
Modified: Catalyst-Runtime/5.80/trunk/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/trunk/Makefile.PL 2010-08-26 00:20:05 UTC (rev 13544)
+++ Catalyst-Runtime/5.80/trunk/Makefile.PL 2010-08-26 00:20:16 UTC (rev 13545)
@@ -28,6 +28,7 @@
requires 'Data::Dump';
requires 'Data::OptList';
requires 'HTML::Entities';
+requires 'HTML::HeadParser';
requires 'HTTP::Body' => '1.06'; # ->cleanup(1)
requires 'HTTP::Headers' => '1.64';
requires 'HTTP::Request' => '5.814';
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Test.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Test.pm 2010-08-26 00:20:05 UTC (rev 13544)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Test.pm 2010-08-26 00:20:16 UTC (rev 13545)
@@ -239,6 +239,21 @@
my $response = $cgi->restore->response;
$response->request( $request );
+
+ # HTML head parsing based on LWP::UserAgent
+
+ require HTML::HeadParser;
+
+ my $parser = HTML::HeadParser->new();
+ $parser->xml_mode(1) if $response->content_is_xhtml;
+ $parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40;
+
+ $parser->parse( $response->content );
+ my $h = $parser->header;
+ for my $f ( $h->header_field_names ) {
+ $response->init_header( $f, [ $h->header($f) ] );
+ }
+
return $response;
}
Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Root.pm 2010-08-26 00:20:05 UTC (rev 13544)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Root.pm 2010-08-26 00:20:16 UTC (rev 13545)
@@ -49,6 +49,22 @@
$c->forward( 'recursion_test' );
}
+sub base_href_test : Local {
+ my ( $self, $c ) = @_;
+
+ my $body = <<"EndOfBody";
+<html>
+ <head>
+ <base href="http://www.example.com/">
+ </head>
+ <body>
+ </body>
+</html>
+EndOfBody
+
+ $c->response->body($body);
+}
+
sub end : Private {
my ($self,$c) = @_;
}
Modified: Catalyst-Runtime/5.80/trunk/t/live_catalyst_test.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/live_catalyst_test.t 2010-08-26 00:20:05 UTC (rev 13544)
+++ Catalyst-Runtime/5.80/trunk/t/live_catalyst_test.t 2010-08-26 00:20:16 UTC (rev 13545)
@@ -3,7 +3,7 @@
use Catalyst::Test 'TestApp', {default_host => 'default.com'};
use Catalyst::Request;
-use Test::More tests => 8;
+use Test::More tests => 9;
content_like('/',qr/root/,'content check');
action_ok('/','Action ok ok','normal action ok');
@@ -11,6 +11,12 @@
action_notfound('/engine/response/status/s404','notfound check');
contenttype_is('/action/local/one','text/plain','Contenttype check');
+### local_request() was not setting response base from base href
+{
+ my $response = request('/base_href_test');
+ is( $response->base, 'http://www.example.com/', 'response base set from base href');
+}
+
my $creq;
my $req = '/dump/request';
More information about the Catalyst-commits
mailing list