Commit | Line | Data |
---|---|---|
e60dc79f | 1 | use strict; |
f54428ab | 2 | use warnings; |
7e36a763 | 3 | |
e60dc79f | 4 | use Test::More; |
7e36a763 | 5 | use lib qw(t/lib); |
6 | use DBICTest; | |
e60dc79f | 7 | |
7e36a763 | 8 | my $schema = DBICTest->init_schema(); |
e60dc79f | 9 | |
e60dc79f | 10 | { |
11 | my @warnings; | |
12 | local $SIG{__WARN__} = sub { push @warnings, @_; }; | |
13 | { | |
14 | # Test that this doesn't cause infinite recursion. | |
7e36a763 | 15 | local *DBICTest::Artist::DESTROY; |
16 | local *DBICTest::Artist::DESTROY = sub { $_[0]->discard_changes }; | |
f54428ab | 17 | |
7e36a763 | 18 | my $artist = $schema->resultset("Artist")->create( { |
19 | artistid => 10, | |
20 | name => "artist number 10", | |
21 | }); | |
f54428ab | 22 | |
7e36a763 | 23 | $artist->name("Wibble"); |
f54428ab | 24 | |
7e36a763 | 25 | print "# About to call DESTROY\n"; |
e60dc79f | 26 | } |
27 | is_deeply \@warnings, []; | |
f54428ab | 28 | } |
29 | ||
30 | done_testing; |