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