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