#!/usr/bin/perl -w
use strict;
+use warnings;
+
use Test::More;
+use lib qw(t/lib);
+use DBICTest;
-BEGIN {
- eval "use DBIx::Class::CDBICompat;";
- plan $@ ? (skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@")
- : (tests=> 1);
-}
+my $schema = DBICTest->init_schema();
-INIT {
- use lib 't/testlib';
- use Film;
-}
+plan tests => 1;
{
my @warnings;
local $SIG{__WARN__} = sub { push @warnings, @_; };
{
# Test that this doesn't cause infinite recursion.
- local *Film::DESTROY;
- local *Film::DESTROY = sub { $_[0]->discard_changes };
+ local *DBICTest::Artist::DESTROY;
+ local *DBICTest::Artist::DESTROY = sub { $_[0]->discard_changes };
+
+ my $artist = $schema->resultset("Artist")->create( {
+ artistid => 10,
+ name => "artist number 10",
+ });
+
+ $artist->name("Wibble");
- my $film = Film->insert({ Title => "Eegah!" });
- $film->director("Arch Hall Sr.");
+ print "# About to call DESTROY\n";
}
is_deeply \@warnings, [];
}
\ No newline at end of file