From: Peter Rabbitson Date: Fri, 21 Dec 2012 10:05:40 +0000 (+0100) Subject: Reverting a48693f42e - the test is a fat duplicate of t/prefetch/false_colvalues.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e327f12657df75fbc8d771b4b8d4495cf1dcbd79;p=dbsrgits%2FDBIx-Class-Historic.git Reverting a48693f42e - the test is a fat duplicate of t/prefetch/false_colvalues.t --- diff --git a/TODO_SHORTTERM b/TODO_SHORTTERM deleted file mode 100644 index 6a53121..0000000 --- a/TODO_SHORTTERM +++ /dev/null @@ -1,2 +0,0 @@ -* a48693f4 adds 5 files for a test that may even be the same as that from -571df676 - please rewrite using the existing schema and delete the rest diff --git a/t/lib/PrefetchBug/Left.pm b/t/lib/PrefetchBug/Left.pm deleted file mode 100644 index 34d362b..0000000 --- a/t/lib/PrefetchBug/Left.pm +++ /dev/null @@ -1,20 +0,0 @@ -package PrefetchBug::Left; - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -__PACKAGE__->table('prefetchbug_left'); -__PACKAGE__->add_columns( - id => { data_type => 'integer', is_auto_increment => 1 }, -); - -__PACKAGE__->set_primary_key('id'); - -__PACKAGE__->has_many( - prefetch_leftright => 'PrefetchBug::LeftRight', - 'left_id' -); - -1; diff --git a/t/lib/PrefetchBug/LeftRight.pm b/t/lib/PrefetchBug/LeftRight.pm deleted file mode 100644 index 8ac1362..0000000 --- a/t/lib/PrefetchBug/LeftRight.pm +++ /dev/null @@ -1,24 +0,0 @@ -package - PrefetchBug::LeftRight; - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -__PACKAGE__->table('prefetchbug_left_right'); -__PACKAGE__->add_columns( - left_id => { data_type => 'integer' }, - right_id => { data_type => 'integer' }, - value => {}); - -__PACKAGE__->set_primary_key('left_id', 'right_id'); -__PACKAGE__->belongs_to(left => 'PrefetchBug::Left', 'left_id'); -__PACKAGE__->belongs_to( - right => 'PrefetchBug::Right', - 'right_id', -# {join_type => 'left'} -); - - -1; diff --git a/t/lib/PrefetchBug/Right.pm b/t/lib/PrefetchBug/Right.pm deleted file mode 100644 index c99dea7..0000000 --- a/t/lib/PrefetchBug/Right.pm +++ /dev/null @@ -1,14 +0,0 @@ -package - PrefetchBug::Right; - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -__PACKAGE__->table('prefetchbug_right'); -__PACKAGE__->add_columns(qw/ id name category description propagates locked/); -__PACKAGE__->set_primary_key('id'); - -__PACKAGE__->has_many('prefetch_leftright', 'PrefetchBug::LeftRight', 'right_id'); -1; diff --git a/t/prefetch/undef_prefetch_bug.t b/t/prefetch/undef_prefetch_bug.t deleted file mode 100644 index 2304309..0000000 --- a/t/prefetch/undef_prefetch_bug.t +++ /dev/null @@ -1,51 +0,0 @@ -use strict; -use warnings; - -use Test::More; -use lib qw(t/lib); -use DBICTest; -use PrefetchBug; - -my $schema = PrefetchBug->connect( DBICTest->_database (quote_char => '"') ); -ok( $schema, 'Connected to PrefetchBug schema OK' ); - -$schema->storage->dbh->do(<<"EOF"); -CREATE TABLE prefetchbug_left ( - id INTEGER PRIMARY KEY -) -EOF - -$schema->storage->dbh->do(<<"EOF"); -CREATE TABLE prefetchbug_right ( - id INTEGER PRIMARY KEY, - name TEXT, - category TEXT, - description TEXT, - propagates INT, - locked INT -) -EOF - -$schema->storage->dbh->do(<<"EOF"); -CREATE TABLE prefetchbug_left_right ( - left_id INTEGER REFERENCES prefetchbug_left(id), - right_id INTEGER REFERENCES prefetchbug_right(id), - value TEXT, - PRIMARY KEY (left_id, right_id) -) -EOF - -# Test simple has_many prefetch: - -my $leftc = $schema->resultset('Left')->create({}); - -my $rightc = $schema->resultset('Right')->create({ id => 60, name => 'Johnny', category => 'something', description=> 'blah', propagates => 0, locked => 1 }); -$rightc->create_related('prefetch_leftright', { left => $leftc, value => 'lr' }); - -# start with fresh whatsit -my $left = $schema->resultset('Left')->find({ id => $leftc->id }); - -my @left_rights = $left->search_related('prefetch_leftright', {}, { prefetch => 'right' }); -ok(defined $left_rights[0]->right, 'Prefetched Right side correctly'); - -done_testing;