[Catalyst-commits] r7979 - in Catalyst-Runtime/5.80/trunk: . lib
lib/Catalyst lib/Catalyst/DispatchType t
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Mon Jun 23 22:18:50 BST 2008
Author: groditi
Date: 2008-06-23 22:18:49 +0100 (Mon, 23 Jun 2008)
New Revision: 7979
Modified:
Catalyst-Runtime/5.80/trunk/
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Action.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionChain.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Default.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Index.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Regex.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Model.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm
Catalyst-Runtime/5.80/trunk/t/live_engine_request_parameters.t
Log:
r17794 at martha (orig r7725): konobi | 2008-05-08 14:42:41 -0400
* Updated Catalyst::Request and Catalyst::Response to have sensible defaults for attributes
* Updated Catalyst.pm to reflect sensible defaults
* Worked through some TODO items added by groditi
* Fixed up a test that was testing against object internals rather than accessors
Property changes on: Catalyst-Runtime/5.80/trunk
___________________________________________________________________
Name: svk:merge
- 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:7576
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7718
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
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/trunk:7576
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7725
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
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
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Action.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Action.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Action.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -49,15 +49,15 @@
my ( $self, $c ) = @_;
#Moose todo: grrrrrr. this is no good. i don't know enough about it to
# debug it though. why can't we just call the accessor?
- local $c->{namespace} = $self->namespace;
- return $c->execute( $self->class, $self );
+ #local $c->{namespace} = $self->namespace;
+ #return $c->execute( $self->class, $self );
#believed to be equivalent:
- #my $orig = $c->namespace;
- #$c->namespace($self->namespace);
- #my $ret = $c->execute( $self->class, $self );
- #$c->namespace($orig);
- #return $ret;
+ my $orig = $c->namespace;
+ $c->namespace($self->namespace);
+ my $ret = $c->execute( $self->class, $self );
+ $c->namespace($orig);
+ return $ret;
}
sub execute {
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionChain.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionChain.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionChain.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -57,6 +57,7 @@
return $self->new({ %$final, chain => $actions });
}
+no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Chained.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -328,6 +328,7 @@
}
+no Moose;
__PACKAGE__->meta->make_immutable;
=head1 USAGE
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Default.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Default.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Default.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -61,6 +61,7 @@
=cut
+no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Index.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Index.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Index.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -69,6 +69,7 @@
=cut
+no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Path.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -140,6 +140,7 @@
=cut
+no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Regex.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Regex.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType/Regex.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -161,6 +161,7 @@
=cut
+no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -71,6 +71,7 @@
=cut
+no Moose;
__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -171,10 +171,11 @@
no warnings 'recursion';
- #moose todo: reaching inside another object is bad
- local $c->request->{arguments} = \@args;
+ my $orig_args = $c->request->arguments();
+ $c->request->arguments(\@args);
$action->dispatch( $c );
-
+ $c->request->arguments($orig_args);
+
return $c->state;
}
@@ -282,7 +283,6 @@
unshift @args, $arg;
}
- #Moose todo: This seems illegible, even if efficient.
s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg for grep { defined } @{$req->captures||[]};
$c->log->debug( 'Path is "' . $req->match . '"' )
@@ -531,6 +531,7 @@
return @loaded;
}
+no Moose;
__PACKAGE__->meta->make_immutable;
=head2 meta
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -130,9 +130,6 @@
# Don't show body parser in the dump
delete $c->req->{_body};
- # Don't show response header state in dump
- delete $c->res->{_finalized_headers};
-
my @infos;
my $i = 0;
for my $dump ( $c->dump_these ) {
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -71,6 +71,7 @@
extends($CATALYST_EXCEPTION_CLASS || 'Catalyst::Exception::Base');
}
-Catalyst::Exception->meta->make_immutable;
+no Moose;
+__PACKAGE__->meta->make_immutable;
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -99,6 +99,9 @@
print STDERR @_;
}
+no Moose;
+__PACKAGE__->meta->make_immutable();
+
1;
__END__
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Model.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Model.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Model.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -3,6 +3,9 @@
use Moose;
extends qw/Catalyst::Component/;
+no Moose;
+__PACKAGE__->meta->make_immutable();
+
=head1 NAME
Catalyst::Model - Catalyst Model base class
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -6,6 +6,7 @@
use URI::http;
use URI::https;
use URI::QueryParam;
+use HTTP::Headers;
use Moose;
@@ -26,6 +27,9 @@
is => 'rw',
isa => 'HTTP::Headers',
handles => [qw(content_encoding content_length content_type header referer user_agent)],
+ default => sub { HTTP::Headers->new() },
+ required => 1,
+ lazy => 1,
);
has _context => (
@@ -54,7 +58,7 @@
before uploads => sub {
my ($self) = @_;
- $self->_context->prepare_body;
+ #$self->_context->prepare_body;
};
has parameters => (
@@ -66,7 +70,7 @@
before parameters => sub {
my ($self, $params) = @_;
- $self->_context->prepare_body();
+ #$self->_context->prepare_body();
if ( $params && !ref $params ) {
$self->_context->log->warn(
"Attempt to retrieve '$params' with req->params(), " .
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -1,16 +1,20 @@
package Catalyst::Response;
use Moose;
+use HTTP::Headers;
-has cookies => (is => 'rw');
-has body => (is => 'rw');
+has cookies => (is => 'rw', default => sub { {} });
+has body => (is => 'rw', default => '');
has location => (is => 'rw');
-has status => (is => 'rw');
+has status => (is => 'rw', default => 200);
+has finalized_headers => (is => 'rw', default => 0);
has headers => (
is => 'rw',
handles => [qw(content_encoding content_length content_type header)],
+ default => sub { HTTP::Headers->new() },
+ required => 1,
+ lazy => 1,
);
-
has _context => (
is => 'rw',
weak_ref => 1,
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Stats.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -120,6 +120,9 @@
return $visitor->getResult;
}
+no Moose;
+__PACKAGE__->meta->make_immutable();
+
1;
__END__
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/View.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -64,4 +64,7 @@
=cut
+no Moose;
+__PACKAGE__->meta->make_immutable();
+
1;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2008-06-23 21:18:49 UTC (rev 7979)
@@ -29,14 +29,14 @@
BEGIN { require 5.008001; }
-has stack => (is => 'rw');
-has stash => (is => 'rw');
-has state => (is => 'rw');
+has stack => (is => 'rw', default => sub { [] });
+has stash => (is => 'rw', default => sub { {} });
+has state => (is => 'rw', default => 0);
has stats => (is => 'rw');
has action => (is => 'rw');
-has counter => (is => 'rw');
-has request => (is => 'rw');
-has response => (is => 'rw');
+has counter => (is => 'rw', default => sub { {} });
+has request => (is => 'rw', default => sub { $_[0]->request_class->new({}) }, required => 1, lazy => 1);
+has response => (is => 'rw', default => sub { $_[0]->response_class->new({}) }, required => 1, lazy => 1);
has namespace => (is => 'rw');
@@ -46,9 +46,16 @@
# Laziness++
*comp = \&component;
-*req = \&request;
-*res = \&response;
+sub req {
+ # carp "the use of req() is deprecated in favour of request()";
+ my $self = shift; return $self->request(@_);
+}
+sub res {
+ # carp "the use of res() is deprecated in favour of response()";
+ my $self = shift; return $self->response(@_);
+}
+
# For backwards compatibility
*finalize_output = \&finalize_body;
@@ -330,7 +337,7 @@
=cut
-sub forward { my $c = shift; $c->dispatcher->forward( $c, @_ ) }
+sub forward { my $c = shift; no warnings 'recursion'; $c->dispatcher->forward( $c, @_ ) }
=head2 $c->detach( $action [, \@arguments ] )
@@ -375,14 +382,16 @@
around stash => sub {
my $orig = shift;
my $c = shift;
+
+ my $orig_stash = $c->$orig();
if (@_) {
my $stash = @_ > 1 ? {@_} : $_[0];
croak('stash takes a hash or hashref') unless ref $stash;
foreach my $key ( keys %$stash ) {
- $c->$orig()->{$key} = $stash->{$key};
+ $orig_stash->{$key} = $stash->{$key};
}
}
- return $c->$orig();
+ return $orig_stash;
};
=head2 $c->error
@@ -1429,9 +1438,8 @@
my $response = $c->response; #accessor calls can add up?
- # Moose TODO: Maybe this should be an attribute too?
# Check if we already finalized headers
- return if $response->{_finalized_headers};
+ return if $response->finalized_headers;
# Handle redirects
if ( my $location = $response->redirect ) {
@@ -1478,7 +1486,7 @@
$c->engine->finalize_headers( $c, @_ );
# Done
- $response->{_finalized_headers} = 1;
+ $response->finalized_headers(1);
}
=head2 $c->finalize_output
@@ -1548,8 +1556,10 @@
}
$COUNT++;
- #todo: reuse coderef from can
- $class->log->_flush() if $class->log->can('_flush');
+
+ if(my $coderef = $class->log->can('_flush')){
+ $class->log->$coderef();
+ }
return $status;
}
@@ -1563,50 +1573,23 @@
sub prepare {
my ( $class, @arguments ) = @_;
- #moose todo: context_class as attr with default
+ # XXX
+ # After the app/ctxt split, this should become an attribute based on something passed
+ # into the application.
$class->context_class( ref $class || $class ) unless $class->context_class;
- #Moose TODO: if we make empty containers the defaults then that can be
- #handled by the context class itself instead of having this here
- my $c = $class->context_class->new(
- {
- counter => {},
- stack => [],
- request => $class->request_class->new(
- {
- arguments => [],
- body_parameters => {},
- cookies => {},
- headers => HTTP::Headers->new,
- parameters => {},
- query_parameters => {},
- secure => 0,
- captures => [],
- uploads => {}
- }
- ),
- response => $class->response_class->new(
- {
- body => '',
- cookies => {},
- headers => HTTP::Headers->new(),
- status => 200
- }
- ),
- stash => {},
- state => 0
- }
- );
+
+ my $c = $class->context_class->new({});
+ # For on-demand data
+ $c->request->_context($c);
+ $c->response->_context($c);
+
#surely this is not the most efficient way to do things...
$c->stats($class->stats_class->new)->enable($c->use_stats);
if ( $c->debug ) {
$c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION );
}
- # For on-demand data
- $c->request->_context($c);
- $c->response->_context($c);
-
#XXX reuse coderef from can
# Allow engine to direct the prepare flow (for POE)
if ( $c->engine->can('prepare') ) {
Modified: Catalyst-Runtime/5.80/trunk/t/live_engine_request_parameters.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/live_engine_request_parameters.t 2008-06-23 21:18:34 UTC (rev 7978)
+++ Catalyst-Runtime/5.80/trunk/t/live_engine_request_parameters.t 2008-06-23 21:18:49 UTC (rev 7979)
@@ -32,7 +32,7 @@
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
isa_ok( $creq, 'Catalyst::Request' );
is( $creq->method, 'GET', 'Catalyst::Request method' );
- is_deeply( $creq->{parameters}, $parameters,
+ is_deeply( $creq->parameters, $parameters,
'Catalyst::Request parameters' );
}
@@ -43,7 +43,7 @@
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
ok( eval '$creq = ' . $response->content );
- is $creq->{parameters}->{q}, 'foo+bar', '%2b not double decoded';
+ is $creq->parameters->{q}, 'foo+bar', '%2b not double decoded';
}
{
@@ -53,7 +53,7 @@
ok( $response->is_success, 'Response Successful 2xx' );
is( $response->content_type, 'text/plain', 'Response Content-Type' );
ok( eval '$creq = ' . $response->content );
- is $creq->{parameters}->{q}, 'foo=bar', '= not ignored';
+ is $creq->parameters->{q}, 'foo=bar', '= not ignored';
}
{
@@ -84,10 +84,10 @@
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
isa_ok( $creq, 'Catalyst::Request' );
is( $creq->method, 'POST', 'Catalyst::Request method' );
- is_deeply( $creq->{parameters}, $parameters,
+ is_deeply( $creq->parameters, $parameters,
'Catalyst::Request parameters' );
is_deeply( $creq->arguments, [qw(a b)], 'Catalyst::Request arguments' );
- is_deeply( $creq->{uploads}, {}, 'Catalyst::Request uploads' );
+ is_deeply( $creq->uploads, {}, 'Catalyst::Request uploads' );
is_deeply( $creq->cookies, {}, 'Catalyst::Request cookie' );
}
@@ -109,7 +109,7 @@
ok( my $response = request($request), 'Request' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
- is_deeply( $creq->{parameters}, $parameters, 'Catalyst::Request parameters' );
+ is_deeply( $creq->parameters, $parameters, 'Catalyst::Request parameters' );
}
# raw query string support
@@ -129,11 +129,11 @@
ok( my $response = request($request), 'Request' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
- is( $creq->{uri}->query, 'query+string', 'Catalyst::Request POST query_string' );
+ is( $creq->uri->query, 'query+string', 'Catalyst::Request POST query_string' );
is( $creq->query_keywords, 'query string', 'Catalyst::Request query_keywords' );
- is_deeply( $creq->{parameters}, $parameters, 'Catalyst::Request parameters' );
+ is_deeply( $creq->parameters, $parameters, 'Catalyst::Request parameters' );
ok( $response = request('http://localhost/dump/request/a/b?x=1&y=1&z=1'), 'Request' );
ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' );
- is( $creq->{uri}->query, 'x=1&y=1&z=1', 'Catalyst::Request GET query_string' );
+ is( $creq->uri->query, 'x=1&y=1&z=1', 'Catalyst::Request GET query_string' );
}
More information about the Catalyst-commits
mailing list