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