Adjust MANIFEST
[dbsrgits/DBIx-Class.git] / t / cdbi-t / set_to_undef.t
CommitLineData
4c9f72c1 1#!/usr/bin/perl -w
2
3use strict;
4use Test::More;
4c9f72c1 5
6BEGIN {
7 eval "use DBIx::Class::CDBICompat;";
8 plan skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@"
9 if $@;
10 plan skip_all => "DateTime required" unless eval { require DateTime };
1f17ec27 11 plan tests => 2;
4c9f72c1 12}
13
1f17ec27 14
15# Don't use Test::NoWarnings because of an unrelated DBD::SQLite warning.
16my @warnings;
17local $SIG{__WARN__} = sub {
18 push @warnings, @_;
19};
14e38771 20
4c9f72c1 21{
22 package Thing;
23
24 use base 'DBIx::Class::Test::SQLite';
25
26 Thing->columns(All => qw[thing_id this that date]);
27}
28
29my $thing = Thing->construct({ thing_id => 23, this => 42 });
30$thing->set( this => undef );
1f17ec27 31is $thing->get( "this" ), undef, 'undef set';
4c9f72c1 32$thing->discard_changes;
1f17ec27 33
34is @warnings, 0, 'no warnings';