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