File: accept_context_regression.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (42 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use strict;
use warnings;
use Test::More;

BEGIN {
  package MyApp::Model::AcceptContext;
  use base 'Catalyst::Model';

  sub ACCEPT_CONTEXT {
    my ($self, $c, @args) = @_;
    Test::More::ok( ref $c);
  }

  $INC{'MyApp/Model/AcceptContext.pm'} = __FILE__;
}

BEGIN {
  package MyApp::Controller::Root;
  use base 'Catalyst::Controller';

  sub test_model :Local {
    my ($self, $c) = @_;
    $c->res->body('test');
  }

  $INC{'MyApp/Controller/Root.pm'} = __FILE__;
}

BEGIN {
  package MyApp;
  use Catalyst;

  MyApp->setup;
}

use Catalyst::Test 'MyApp';

my ($res, $c) = ctx_request('/root/test_model');

ok $res;

done_testing;