[Bast-commits] r8156 -
DBIx-Class/0.08/branches/null_column_regression/t/resultset
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Dec 19 11:51:22 GMT 2009
Author: ribasushi
Date: 2009-12-19 11:51:21 +0000 (Sat, 19 Dec 2009)
New Revision: 8156
Added:
DBIx-Class/0.08/branches/null_column_regression/t/resultset/nulls_only.t
Log:
Failing test
Added: DBIx-Class/0.08/branches/null_column_regression/t/resultset/nulls_only.t
===================================================================
--- DBIx-Class/0.08/branches/null_column_regression/t/resultset/nulls_only.t (rev 0)
+++ DBIx-Class/0.08/branches/null_column_regression/t/resultset/nulls_only.t 2009-12-19 11:51:21 UTC (rev 8156)
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+
+use lib qw(t/lib);
+use Test::More;
+use Test::Exception;
+use DBICTest;
+
+my $schema = DBICTest->init_schema();
+
+
+my $cd_rs = $schema->resultset('CD')->search ({ genreid => undef }, { columns => [ 'genreid' ]} );
+my $count = $cd_rs->count;
+cmp_ok ( $count, '>', 1, 'several CDs with no genre');
+
+my @objects = $cd_rs->all;
+is (scalar @objects, $count, 'Correct amount of objects without limit');
+isa_ok ($_, 'DBICTest::CD') for @objects;
+
+is_deeply (
+ [ map { values %{{$_->get_columns}} } (@objects) ],
+ [ (undef) x $count ],
+ 'All values are indeed undef'
+);
+
+
+isa_ok ($cd_rs->search ({}, { rows => 1 })->single, 'DBICTest::CD');
+
+done_testing;
More information about the Bast-commits
mailing list