]> git.decadent.org.uk Git - maypole.git/blob - t/apache_mvc.t
Merge branch 'upstream'
[maypole.git] / t / apache_mvc.t
1 #!/usr/bin/perl -w
2 use strict;
3 use Test::More;
4
5 BEGIN {
6     if (eval { require Apache2::RequestRec }) {
7        $ENV{MOD_PERL_API_VERSION} = 2;
8         plan tests => 3;
9     } elsif (eval { require Apache::Request }) {
10         plan tests => 3;
11     } else {
12         Test::More->import(skip_all =>"Neither Apache2::RequestRec nor Apache::Request is installed: $@");
13     }
14 }
15
16 require_ok('Apache::MVC');
17 ok($Apache::MVC::VERSION, 'defines $VERSION');
18 ok(Apache::MVC->can('ar'), 'defines an "ar" accessor');
19
20 # defines $VERSION
21 # uses mod_perl
22 # @ISA = 'Maypole'
23 # sets APACHE2 constant
24 # loads Apache::Request
25 # loads mod_perl2 modules if APACHE2
26 # otherwise, loads Apache
27 # get_request()
28 # ... sets 'ar' to new Apache::Request object
29 # parse_location()
30 # ... sets path() to request URI - base URI
31 # ... calls parse_path
32 # ... calls parse_args
33 # parse_args()
34 # ... calls _mod_perl_args(), to set params
35 # ... calls _mod_perl_args(), to set query
36 # send_output()
37 # ... sets get_request->content_type to r->content_type
38 # ... appends document_encoding() if content_type is text
39 # ... sets Content-Length header
40 # ... calls get_request->send_http_header unless APACHE2
41 # ... prints the request output
42 # get_template_root()
43 # ... catdir(document_root, location)
44 # _mod_perl_args()
45 # ... returns a hash of args from get_request->param