Cleanup test and log fix
[dbsrgits/DBIx-Class.git] / t / 89inflate_datetime.t
index 4145749..85bddeb 100644 (file)
@@ -10,7 +10,7 @@ my $schema = DBICTest->init_schema();
 eval { require DateTime::Format::MySQL };
 plan skip_all => "Need DateTime::Format::MySQL for inflation tests" if $@;
 
-plan tests => 4;
+plan tests => 8;
 
 # inflation test
 my $event = $schema->resultset("Event")->find(1);
@@ -23,9 +23,22 @@ is($starts, '2006-04-25T22:24:33', 'Correct date/time');
 
 # create using DateTime
 my $created = $schema->resultset('Event')->create({
-    starts_at => DateTime->new(year=>2006, month=>6, day=>18)
+    starts_at => DateTime->new(year=>2006, month=>6, day=>18),
+    created_on => DateTime->new(year=>2006, month=>6, day=>23)
 });
 my $created_start = $created->starts_at;
 
 isa_ok($created->starts_at, 'DateTime', 'DateTime returned');
 is($created_start, '2006-06-18T00:00:00', 'Correct date/time');
+
+## timestamp field
+isa_ok($event->created_on, 'DateTime', 'DateTime returned');
+
+# klunky, but makes older Test::More installs happy
+my $createo = $event->created_on . '';
+is($createo, '2006-06-22T21:00:05', 'Correct date/time');
+
+my $created_cron = $created->created_on;
+
+isa_ok($created->created_on, 'DateTime', 'DateTime returned');
+is($created_cron, '2006-06-23T00:00:00', 'Correct date/time');