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