Patch from jesper to work round dumbass DBDs
[dbsrgits/DBIx-Class.git] / t / run / 01core.tl
index ce41f16..27868df 100644 (file)
@@ -1,7 +1,7 @@
 sub run_tests {
 my $schema = shift;
 
-plan tests => 34; 
+plan tests => 36; 
 
 my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
 
@@ -91,10 +91,10 @@ is($cd->year, 2005, 'set_columns ok');
 
 $cd->discard_changes;
 
-# check whether ResultSource->ordered_columns returns columns in order originally supplied
-my @cd = $schema->source("CD")->ordered_columns;
+# check whether ResultSource->columns returns columns in order originally supplied
+my @cd = $schema->source("CD")->columns;
 
-is_deeply( \@cd, [qw/cdid artist title year/], 'ordered_columns');
+is_deeply( \@cd, [qw/cdid artist title year/], 'column order');
 
 $cd = $schema->resultset("CD")->search({ title => 'Spoonful of bees' }, { cols => ['title'] })->next;
 is($cd->title, 'Spoonful of bees', 'subset of columns returned correctly');
@@ -140,6 +140,13 @@ cmp_ok($rel_rs->count, '==', 5, 'Related search ok');
 
 cmp_ok($or_rs->next->cdid, '==', $rel_rs->next->cdid, 'Related object ok');
 
+
+ok($schema->storage(), 'Storage available');
+
+$schema->source("Artist")->{_columns}{'artistid'} = {};
+
+my $typeinfo = $schema->source("Artist")->column_info('artistid');
+is($typeinfo->{data_type}, 'INTEGER', 'column_info ok');
 }
 
 1;