fixing possible problem when ACCEPT_CONTEXT is already defined
[catagits/Catalyst-Runtime.git] / t / lib / TestAppCustomContainer / Role / ACCEPT_CONTEXT.pm
CommitLineData
b463fcad 1package TestAppCustomContainer::Role::ACCEPT_CONTEXT;
2use Moose::Role;
3use namespace::autoclean;
4
5has accept_context_called => (
6 traits => ['Counter'],
7 isa => 'Int',
8 is => 'ro',
9 default => 0,
10 handles => {
11 inc_accept_context_called => 'inc',
12 },
13);
14
cd547805 15sub ACCEPT_CONTEXT {}
16
17around ACCEPT_CONTEXT => sub {
18 my ( $orig, $self, $ctx, @args ) = @_;
b463fcad 19
20 $self->inc_accept_context_called;
21
cd547805 22 return $self->$orig() || $self;
23};
b463fcad 24
251;