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