Prevent invisible skipping of ResultSource proxy overrides
[dbsrgits/DBIx-Class.git] / t / delete / cascade_missing.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use Test::Warn;
8 use Test::Exception;
9
10
11 use DBICTest;
12
13 my $schema = DBICTest->init_schema();
14 $schema->_unregister_source('CD');
15
16 warnings_exist {
17   my $s = $schema;
18   lives_ok {
19     $_->delete for $s->resultset('Artist')->all;
20   } 'delete on rows with dangling rels lives';
21 } [
22   # 9 == 3 artists * failed cascades:
23   #   cds
24   #   cds_unordered
25   #   cds_very_very_very_long_relationship_name
26   (qr/skipping cascad/i) x 9
27 ], 'got warnings about cascading deletes';
28
29 done_testing;
30