Commit | Line | Data |
83542a7d |
1 | #!perl -T |
2 | |
3 | # the above line forces Test::Harness into taint-mode |
4 | |
5 | use strict; |
6 | use warnings; |
7 | |
91b0ad0b |
8 | use Test::More; |
f3405058 |
9 | BEGIN { plan tests => 7 } |
83542a7d |
10 | |
91b0ad0b |
11 | package DBICTest::Taint::Classes; |
83542a7d |
12 | |
91b0ad0b |
13 | use Test::More; |
14 | use Test::Exception; |
83542a7d |
15 | |
16 | use lib qw(t/lib); |
91b0ad0b |
17 | use base qw/DBIx::Class::Schema/; |
18 | |
19 | lives_ok (sub { |
20 | __PACKAGE__->load_classes(qw/Manual/); |
21 | ok( __PACKAGE__->source('Manual'), 'The Classes::Manual source has been registered' ); |
22 | __PACKAGE__->_unregister_source (qw/Manual/); |
23 | }, 'Loading classes with explicit load_classes worked in taint mode' ); |
24 | |
25 | lives_ok (sub { |
26 | __PACKAGE__->load_classes(); |
27 | ok( __PACKAGE__->source('Auto'), 'The Classes::Auto source has been registered' ); |
28 | ok( __PACKAGE__->source('Auto'), 'The Classes::Manual source has been re-registered' ); |
29 | }, 'Loading classes with Module::Find/load_classes worked in taint mode' ); |
30 | |
83542a7d |
31 | |
91b0ad0b |
32 | package DBICTest::Taint::Namespaces; |
83542a7d |
33 | |
91b0ad0b |
34 | use Test::More; |
35 | use Test::Exception; |
36 | |
37 | use lib qw(t/lib); |
83542a7d |
38 | use base qw/DBIx::Class::Schema/; |
39 | |
91b0ad0b |
40 | lives_ok (sub { |
41 | __PACKAGE__->load_namespaces(); |
42 | ok( __PACKAGE__->source('Test'), 'The Namespaces::Test source has been registered' ); |
43 | }, 'Loading classes with Module::Find/load_namespaces worked in taint mode' ); |
44 | |
83542a7d |
45 | 1; |