[Bast-commits] r3716 - in DBIx-Class/0.08/branches/cdbicompat_integration: . t/cdbi-t t/testlib

schwern at dev.catalyst.perl.org schwern at dev.catalyst.perl.org
Fri Aug 31 10:17:42 GMT 2007


Author: schwern
Date: 2007-08-31 10:17:41 +0100 (Fri, 31 Aug 2007)
New Revision: 3716

Added:
   DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/08-inheritcols.t
   DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/22-deflate_order.t
   DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/26-mutator.t
Modified:
   DBIx-Class/0.08/branches/cdbicompat_integration/
   DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyBase.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyFoo.pm
   DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/PgBase.pm
Log:
 r32769 at windhund:  schwern | 2007-08-10 02:56:14 -0700
 Pull in some tests from CDBI 3.16 that already work.
 
 Try to fix some issues with the testlibs.



Property changes on: DBIx-Class/0.08/branches/cdbicompat_integration
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:32768
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:3703
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:32769
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:3703
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606

Added: DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/08-inheritcols.t
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/08-inheritcols.t	                        (rev 0)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/08-inheritcols.t	2007-08-31 09:17:41 UTC (rev 3716)
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 3;
+
+use Class::DBI;
+
+package A;
+ at A::ISA = qw(Class::DBI);
+__PACKAGE__->columns(Primary => 'id');
+
+package A::B;
+ at A::B::ISA = 'A';
+__PACKAGE__->columns(All => qw(id b1));
+
+package A::C;
+ at A::C::ISA = 'A';
+__PACKAGE__->columns(All => qw(id c1 c2 c3));
+
+package main;
+is join (' ', sort A->columns),    'id',          "A columns";
+is join (' ', sort A::B->columns), 'b1 id',       "A::B columns";
+is join (' ', sort A::C->columns), 'c1 c2 c3 id', "A::C columns";

Added: DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/22-deflate_order.t
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/22-deflate_order.t	                        (rev 0)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/22-deflate_order.t	2007-08-31 09:17:41 UTC (rev 3716)
@@ -0,0 +1,24 @@
+$| = 1;
+use strict;
+
+use Test::More;
+
+eval { require Time::Piece::MySQL };
+plan skip_all => "Need Time::Piece::MySQL for this test" if $@;
+
+eval { require 't/testlib/Log.pm' };
+plan skip_all => "Need MySQL for this test" if $@;
+
+plan tests => 2;
+
+package main;
+
+my $log = Log->insert( { message => 'initial message' } );
+ok eval { $log->datetime_stamp }, "Have datetime";
+diag $@ if $@;
+
+$log->message( 'a revised message' );
+$log->update;
+ok eval { $log->datetime_stamp }, "Have datetime after update";
+diag $@ if $@;
+

Added: DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/26-mutator.t
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/26-mutator.t	                        (rev 0)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/cdbi-t/26-mutator.t	2007-08-31 09:17:41 UTC (rev 3716)
@@ -0,0 +1,41 @@
+use strict;
+use Test::More;
+
+BEGIN {
+	eval "use DBD::SQLite";
+	plan $@
+		? (skip_all => 'needs DBD::SQLite for testing')
+		: (tests => 6);
+}
+
+use lib 't/testlib';
+require Film;
+
+sub Film::accessor_name_for {
+	my ($class, $col) = @_;
+	return "sheep" if lc $col eq "numexplodingsheep";
+	return $col;
+}
+
+my $data = {
+	Title    => 'Bad Taste',
+	Director => 'Peter Jackson',
+	Rating   => 'R',
+};
+
+my $bt;
+eval {
+	my $data = $data;
+	$data->{sheep} = 1;
+	ok $bt = Film->insert($data), "Modified accessor - with  
+accessor";
+	isa_ok $bt, "Film";
+};
+is $@, '', "No errors";
+
+eval {
+	ok $bt->sheep(2), 'Modified accessor, set';
+	ok $bt->update, 'Update';
+};
+is $@, '', "No errors";
+

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyBase.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyBase.pm	2007-08-31 09:17:21 UTC (rev 3715)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyBase.pm	2007-08-31 09:17:41 UTC (rev 3716)
@@ -2,8 +2,10 @@
     MyBase;
 
 use strict;
-use base qw(DBIx::Class);
+use base qw(DBIx::Class::CDBICompat);
 
+use DBI;
+
 use vars qw/$dbh/;
 
 my @connect = ("dbi:mysql:test", "", "");

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyFoo.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyFoo.pm	2007-08-31 09:17:21 UTC (rev 3715)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/MyFoo.pm	2007-08-31 09:17:41 UTC (rev 3716)
@@ -13,7 +13,7 @@
 	inflate => sub { Date::Simple->new(shift) },
 	deflate => 'format',
 );
-__PACKAGE__->find_column('tdate')->placeholder("IF(1, CURDATE(), ?)");
+#__PACKAGE__->find_column('tdate')->placeholder("IF(1, CURDATE(), ?)");
 
 sub create_sql {
 	return qq{

Modified: DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/PgBase.pm
===================================================================
--- DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/PgBase.pm	2007-08-31 09:17:21 UTC (rev 3715)
+++ DBIx-Class/0.08/branches/cdbicompat_integration/t/testlib/PgBase.pm	2007-08-31 09:17:41 UTC (rev 3716)
@@ -2,7 +2,7 @@
     PgBase;
 
 use strict;
-use base 'DBIx::Class';
+use base 'DBIx::Class::CDBICompat';
 
 my $db   = $ENV{DBD_PG_DBNAME} || 'template1';
 my $user = $ENV{DBD_PG_USER}   || 'postgres';




More information about the Bast-commits mailing list