Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / t / resultset / nulls_only.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6
7 use Test::More;
8 use DBICTest;
9
10 my $schema = DBICTest->init_schema();
11
12
13 my $cd_rs = $schema->resultset('CD')->search ({ genreid => undef }, { columns => [ 'genreid' ]} );
14 my $count = $cd_rs->count;
15 cmp_ok ( $count, '>', 1, 'several CDs with no genre');
16
17 my @objects = $cd_rs->all;
18 is (scalar @objects, $count, 'Correct amount of objects without limit');
19 isa_ok ($_, 'DBICTest::CD') for @objects;
20
21 is_deeply (
22   [ map { values %{{$_->get_columns}} } (@objects) ],
23   [ (undef) x $count ],
24   'All values are indeed undef'
25 );
26
27
28 isa_ok ($cd_rs->search ({}, { rows => 1 })->single, 'DBICTest::CD');
29
30 done_testing;