Fix lazy loading when the object has been deleted
[dbsrgits/DBIx-Class.git] / t / cdbi-t / construct.t
CommitLineData
e60dc79f 1#!/usr/bin/perl -w
2
3use strict;
4use Test::More;
5
6BEGIN {
7 eval "use DBIx::Class::CDBICompat;";
8 plan $@ ? (skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@")
9 : (tests=> 4);
10}
11
12INIT {
13 use lib 't/testlib';
14 use Film;
15}
16
17Film->insert({
18 Title => "Breaking the Waves",
19 Director => 'Lars von Trier',
20 Rating => 'R'
21});
22
23my $film = Film->construct({
24 Title => "Breaking the Waves",
25 Director => 'Lars von Trier',
26});
27
28isa_ok $film, "Film";
29is $film->title, "Breaking the Waves";
30is $film->director, "Lars von Trier";
31is $film->rating, "R", "constructed objects can get missing data from the db";