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