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