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