# This file documents the revision history for Perl extension Catalyst.
5.8000_04
+ - Remove use of NEXT from the test suite, except for one case
+ which tests if Class::C3::Adopt::NEXT is working (t0m)
- Use a predicate to avoid recursion in cases where the uri
method is overridden by a plugin, and calls the base method,
for example Catalyst::Plugin::SmartURI (t0m)
requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness
requires 'MRO::Compat';
-test_requires 'NEXT';
test_requires 'Class::Data::Inheritable';
if ( ( exists $ENV{AGGREGATE_TESTS} && !$ENV{AGGREGATE_TESTS})
sub execute {
my $self = shift;
my ( $controller, $c ) = @_;
- $self->NEXT::execute( @_ );
+ $self->next::method( @_ );
$c->res->header( 'X-Action-After', $c->stash->{after_message} );
}
my $self = shift;
my ( $controller, $c ) = @_;
$c->stash->{test} = 'works';
- $self->NEXT::execute( @_ );
+ $self->next::method( @_ );
}
1;
package Catalyst::Plugin::Test::Errors;
use strict;
-use NEXT;
+use Class::C3;
sub error {
my $c = shift;
unless ( $_[0] ) {
- return $c->NEXT::error(@_);
+ return $c->next::method(@_);
}
if ( $_[0] =~ /^(Unknown resource|No default action defined)/ ) {
$c->response->headers->push_header( 'X-Catalyst-Error' => $error );
- $c->NEXT::error(@_);
+ $c->next::method(@_);
}
1;
package Catalyst::Plugin::Test::Headers;
use strict;
-use NEXT;
+use Class::C3;
sub prepare {
my $class = shift;
- my $c = $class->NEXT::prepare(@_);
+ my $c = $class->next::method(@_);
$c->response->header( 'X-Catalyst-Engine' => $c->engine );
$c->response->header( 'X-Catalyst-Debug' => $c->debug ? 1 : 0 );
sub prepare_action {
my $c = shift;
- $c->NEXT::prepare_action(@_);
+ $c->next::method(@_);
$c->res->header( 'X-Catalyst-Action' => $c->req->action );
}
package Catalyst::Plugin::Test::Plugin;
use strict;
-use NEXT;
use base qw/Catalyst::Base Class::Data::Inheritable/;
my $class = shift;
+# Note: This use of NEXT is deliberately left here to ensure back
+# compat, as NEXT always used to be loaded, but is now replaced
+# by Class::C3::Adopt::NEXT.
my $c = $class->NEXT::prepare(@_);
$c->response->header( 'X-Catalyst-Plugin-Setup' => $c->ran_setup );
sub finalize_error {
my $c = shift;
- $c->NEXT::finalize_error(@_);
+ $c->next::method(@_);
$c->res->status(500);
$c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
my $self = shift;
my ( $controller, $c, $test ) = @_;
$c->res->header( 'X-TestAppActionTestBefore', $test );
- $self->NEXT::execute( @_ );
+ $self->next::method( @_ );
}
1;
my $self = shift;
my ( $controller, $c, $test ) = @_;
$c->res->header( 'X-TestAppActionTestMyAction', 'MyAction works' );
- $self->NEXT::execute(@_);
+ $self->next::method(@_);
}
1;
write_component_file(\@dir_list, $name_final, <<EOF);
package $fullname;
-use NEXT;
+use Class::C3;
use base '$compbase';
sub COMPONENT {
- my \$self = shift->NEXT::COMPONENT(\@_);
+ my \$self = shift->next::method(\@_);
no strict 'refs';
*{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; };
\$self;
use base 'Catalyst::Model';
sub COMPONENT {
- my \$self = shift->NEXT::COMPONENT(\@_);
+ my \$self = shift->next::method(\@_);
no strict 'refs';
*{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; };
\$self;
use base 'Catalyst::Model';
no warnings 'redefine';
-sub COMPONENT { return shift->NEXT::COMPONENT(\@_); }
+sub COMPONENT { return shift->next::method(\@_); }
1;
EOF