From: Peter Rabbitson Date: Thu, 5 Jan 2012 02:59:41 +0000 (+0100) Subject: Trailing WS crusade - got to save them bits X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8273e845426f0187b4ad6c4a1b42286fa09a648f;p=dbsrgits%2FDBIx-Class-Historic.git Trailing WS crusade - got to save them bits --- diff --git a/Changes b/Changes index 7076eb0..3497d1c 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,9 @@ Revision history for DBIx::Class * Fixes - Fix SkipFirst and FirstSkip limit dialects (Informix and Firebird) + * Misc + - Codebase is now trailing-whitespace-free + 0.08196 2011-11-29 05:35 (UTC) * Fixes - Fix tests for DBD::SQLite >= 1.34. diff --git a/lib/DBIx/Class/Admin/Usage.pm b/lib/DBIx/Class/Admin/Usage.pm index ce41a56..2e02705 100644 --- a/lib/DBIx/Class/Admin/Usage.pm +++ b/lib/DBIx/Class/Admin/Usage.pm @@ -66,7 +66,7 @@ sub pod_option_text { $spec = Getopt::Long::Descriptive->_strip_assignment($spec); $string .= "=item " . join " or ", map { length > 1 ? "B<--$_>" : "B<-$_>" } - split /\|/, $spec; + split /\|/, $spec; $string .= "\n\n$desc\n\n=cut\n\n"; } diff --git a/lib/DBIx/Class/CDBICompat.pm b/lib/DBIx/Class/CDBICompat.pm index 0dddff3..b4c6399 100644 --- a/lib/DBIx/Class/CDBICompat.pm +++ b/lib/DBIx/Class/CDBICompat.pm @@ -62,7 +62,7 @@ DBIx::Class::CDBICompat - Class::DBI Compatibility layer. =head1 DESCRIPTION DBIx::Class features a fully featured compatibility layer with L -and some common plugins to ease transition for existing CDBI users. +and some common plugins to ease transition for existing CDBI users. This is not a wrapper or subclass of DBIx::Class but rather a series of plugins. The result being that even though you're using the Class::DBI emulation layer you are still getting DBIx::Class objects. You can use all DBIx::Class features and methods via CDBICompat. This allows you to take advantage of DBIx::Class features without having to rewrite your CDBI code. @@ -91,7 +91,7 @@ This plugin will work, but it is more efficiently done using DBIC's native searc =head2 Choosing Features In fact, this class is just a recipe containing all the features emulated. -If you like, you can choose which features to emulate by building your +If you like, you can choose which features to emulate by building your own class and loading it like this: package My::DB; diff --git a/lib/DBIx/Class/CDBICompat/AccessorMapping.pm b/lib/DBIx/Class/CDBICompat/AccessorMapping.pm index b7945b0..1ea49e8 100644 --- a/lib/DBIx/Class/CDBICompat/AccessorMapping.pm +++ b/lib/DBIx/Class/CDBICompat/AccessorMapping.pm @@ -35,8 +35,8 @@ sub mk_group_accessors { sub accessor_name_for { my ($class, $column) = @_; - if ($class->can('accessor_name')) { - return $class->accessor_name($column) + if ($class->can('accessor_name')) { + return $class->accessor_name($column) } return $column; @@ -44,8 +44,8 @@ sub accessor_name_for { sub mutator_name_for { my ($class, $column) = @_; - if ($class->can('mutator_name')) { - return $class->mutator_name($column) + if ($class->can('mutator_name')) { + return $class->mutator_name($column) } return $column; diff --git a/lib/DBIx/Class/CDBICompat/LazyLoading.pm b/lib/DBIx/Class/CDBICompat/LazyLoading.pm index 0817ef2..798fcd3 100644 --- a/lib/DBIx/Class/CDBICompat/LazyLoading.pm +++ b/lib/DBIx/Class/CDBICompat/LazyLoading.pm @@ -12,7 +12,7 @@ sub resultset_instance { } -# Emulate that CDBI throws out all changed columns and reloads them on +# Emulate that CDBI throws out all changed columns and reloads them on # request in case the database modifies the new value (say, via a trigger) sub update { my $self = shift; diff --git a/lib/DBIx/Class/DB.pm b/lib/DBIx/Class/DB.pm index c81cda9..804ff67 100644 --- a/lib/DBIx/Class/DB.pm +++ b/lib/DBIx/Class/DB.pm @@ -184,8 +184,8 @@ sub result_source_instance { if ($result_class ne $class) { # new class # Give this new class its own source and register it. - $source = $source->new({ - %$source, + $source = $source->new({ + %$source, source_name => $class, result_class => $class } ); diff --git a/lib/DBIx/Class/InflateColumn/File.pm b/lib/DBIx/Class/InflateColumn/File.pm index 3b17cd2..aa06dbc 100644 --- a/lib/DBIx/Class/InflateColumn/File.pm +++ b/lib/DBIx/Class/InflateColumn/File.pm @@ -29,7 +29,7 @@ sub register_column { return unless defined($info->{is_file_column}); $self->inflate_column($column => { - inflate => sub { + inflate => sub { my ($value, $obj) = @_; $obj->_inflate_file_column($column, $value); }, @@ -155,7 +155,7 @@ In your L table class: data_type => "varchar", is_file_column => 1, file_column_path =>'/tmp/uploaded_files', - # or for a Catalyst application + # or for a Catalyst application # file_column_path => MyApp->path_to('root','static','files'), default_value => undef, is_nullable => 1, @@ -169,11 +169,11 @@ In your L class: FileColumn requires a hash that contains L as handle and the file's name as name. - my $entry = $c->model('MyAppDB::Articles')->create({ + my $entry = $c->model('MyAppDB::Articles')->create({ subject => 'blah', - filename => { - handle => $c->req->upload('myupload')->fh, - filename => $c->req->upload('myupload')->basename + filename => { + handle => $c->req->upload('myupload')->fh, + filename => $c->req->upload('myupload')->basename }, body => '....' }); @@ -183,7 +183,7 @@ name as name. And Place the following in your TT template Article Subject: [% entry.subject %] - Uploaded File: + Uploaded File: File Body: [% entry.body %] diff --git a/lib/DBIx/Class/Manual.pod b/lib/DBIx/Class/Manual.pod index 3585941..60cced0 100644 --- a/lib/DBIx/Class/Manual.pod +++ b/lib/DBIx/Class/Manual.pod @@ -1,10 +1,10 @@ -=head1 NAME +=head1 NAME DBIx::Class::Manual - Index of the Manual =head1 DESCRIPTION -This is the L users manual. DBIx::Class is a SQL->OOP mapper. +This is the L users manual. DBIx::Class is a SQL->OOP mapper. This means that it can represent your SQL tables as perl classes, and give you convenient accessors and methods for retrieving and updating information from your SQL database. @@ -21,7 +21,7 @@ Explanations of terms used in this documentation. =head2 L -Beginner guide to using DBIx::Class. +Beginner guide to using DBIx::Class. =head2 L @@ -52,7 +52,7 @@ documentation. It should behave the same way. =head2 L -Existing components, and documentation and example on how to +Existing components, and documentation and example on how to develop new ones. =cut diff --git a/lib/DBIx/Class/Manual/FAQ.pod b/lib/DBIx/Class/Manual/FAQ.pod index ba6d4d1..40b8555 100644 --- a/lib/DBIx/Class/Manual/FAQ.pod +++ b/lib/DBIx/Class/Manual/FAQ.pod @@ -134,8 +134,8 @@ as you like. See L. =item .. define a relationship bridge across an intermediate table? (many-to-many) -The term 'relationship' is used loosely with many_to_many as it is not considered a -relationship in the fullest sense. For more info, read the documentation on L. +The term 'relationship' is used loosely with many_to_many as it is not considered a +relationship in the fullest sense. For more info, read the documentation on L. =item .. stop DBIx::Class from attempting to cascade deletes on my has_many and might_have relationships? @@ -437,8 +437,8 @@ data out. =head2 Custom methods in Result classes -You can add custom methods that do arbitrary things, even to unrelated tables. -For example, to provide a C<< $book->foo() >> method which searches the +You can add custom methods that do arbitrary things, even to unrelated tables. +For example, to provide a C<< $book->foo() >> method which searches the cd table, you'd could add this to Book.pm: sub foo { @@ -455,7 +455,7 @@ methods to find or create data in related tables for you. But if you want to write your own methods, you can. For example, to provide a C<< $book->foo() >> method to manually implement -what create_related() from L does, you could +what create_related() from L does, you could add this to Book.pm: sub foo { @@ -567,12 +567,12 @@ The code example works for both modules: package Your::Schema::Group; use Class::Method::Modifiers; - + # ... declare columns ... - + __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id'); __PACKAGE__->many_to_many('servers', 'group_servers', 'server'); - + # if the server group is a "super group", then return all servers # otherwise return only servers that belongs to the given group around 'servers' => sub { @@ -592,12 +592,12 @@ L way: package Your::Schema::Group; use Method::Signatures::Simple; - + # ... declare columns ... - + __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id'); __PACKAGE__->many_to_many('servers', 'group_servers', 'server'); - + # The method keyword automatically injects the annoying my $self = shift; for you. method servers { return $self->result_source->schema->resultset('Server')->search({ ... }); @@ -607,17 +607,17 @@ The dirty way: package Your::Schema::Group; use Sub::Name; - + # ... declare columns ... - + __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id'); __PACKAGE__->many_to_many('servers', 'group_servers', 'server'); - + *servers = subname servers => sub { my $self = shift; return $self->result_source->schema->resultset('Server')->search({ ... }); }; - + =back =head2 Notes for CDBI users diff --git a/lib/DBIx/Class/Manual/Glossary.pod b/lib/DBIx/Class/Manual/Glossary.pod index 5cd25b6..2cd6db3 100644 --- a/lib/DBIx/Class/Manual/Glossary.pod +++ b/lib/DBIx/Class/Manual/Glossary.pod @@ -55,7 +55,7 @@ condition between the tables. =head2 Relationship bridge A relationship bridge, such as C defines an accessor to -retrieve row contents across multiple relationships. +retrieve row contents across multiple relationships. The difference between a bridge and a relationship is, that the bridge cannot be used to C tables in a C, instead its component diff --git a/lib/DBIx/Class/Manual/Intro.pod b/lib/DBIx/Class/Manual/Intro.pod index bc18fa8..d27a24a 100644 --- a/lib/DBIx/Class/Manual/Intro.pod +++ b/lib/DBIx/Class/Manual/Intro.pod @@ -116,7 +116,7 @@ automatic row ordering: __PACKAGE__->position_column('rank'); Ordered will refer to a field called 'position' unless otherwise directed. Here you are defining -the ordering field to be named 'rank'. (NOTE: Insert errors may occur if you use the Ordered +the ordering field to be named 'rank'. (NOTE: Insert errors may occur if you use the Ordered component, but have not defined a position column or have a 'position' field in your row.) Set the table for your class: diff --git a/lib/DBIx/Class/Manual/Joining.pod b/lib/DBIx/Class/Manual/Joining.pod index c99ce55..5785349 100644 --- a/lib/DBIx/Class/Manual/Joining.pod +++ b/lib/DBIx/Class/Manual/Joining.pod @@ -1,4 +1,4 @@ -=head1 NAME +=head1 NAME DBIx::Class::Manual::Joining - Manual on joining tables with DBIx::Class @@ -175,14 +175,14 @@ has a very large field you don't need for the current data output. This is better solved by storing that field in a separate table which you only join to when needed. -To fetch an incomplete related object, supply the dotted notation to the '+as' attribute: +To fetch an incomplete related object, supply the dotted notation to the '+as' attribute: $schema->resultset('CD')->search( { 'Title' => 'Funky CD', }, { join => 'tracks', '+select' => ['tracks.Name'], - '+as' => ['tracks.Name'], + '+as' => ['tracks.Name'], order_by => ['tracks.id'], } ); @@ -232,13 +232,13 @@ Which is: To perform joins using relations of the tables you are joining to, use a hashref to indicate the join depth. This can theoretically go as -deep as you like (warning: contrived examples!): +deep as you like (warning: contrived examples!): join => { room => { table => 'leg' } } To join two relations at the same level, use an arrayref instead: - join => { room => [ 'chair', 'table' ] } + join => { room => [ 'chair', 'table' ] } Or combine the two: diff --git a/lib/DBIx/Class/Manual/Reading.pod b/lib/DBIx/Class/Manual/Reading.pod index bcd4610..3754f29 100644 --- a/lib/DBIx/Class/Manual/Reading.pod +++ b/lib/DBIx/Class/Manual/Reading.pod @@ -105,7 +105,7 @@ caller should pass C in place of the missing argument. =item * -| - Alternate argument content types. +| - Alternate argument content types. At least one of these must be supplied unless the argument is also marked optional. diff --git a/lib/DBIx/Class/Manual/Troubleshooting.pod b/lib/DBIx/Class/Manual/Troubleshooting.pod index 820359d..6ca0dd3 100644 --- a/lib/DBIx/Class/Manual/Troubleshooting.pod +++ b/lib/DBIx/Class/Manual/Troubleshooting.pod @@ -51,7 +51,7 @@ L version 1.50 and L 1.43 are known to work. There's likely a syntax error in the table class referred to elsewhere in this error message. In particular make sure that the package -declaration is correct. For example, for a schema C< MySchema > +declaration is correct. For example, for a schema C< MySchema > you need to specify a fully qualified namespace: C< package MySchema::MyTable; >. =head2 syntax error at or near "" ... @@ -149,11 +149,11 @@ L =head2 Excessive Memory Allocation with TEXT/BLOB/etc. Columns and Large LongReadLen -It has been observed, using L, that creating a L -object which includes a column of data type TEXT/BLOB/etc. will allocate -LongReadLen bytes. This allocation does not leak, but if LongReadLen -is large in size, and many such row objects are created, e.g. as the -output of a ResultSet query, the memory footprint of the Perl interpreter +It has been observed, using L, that creating a L +object which includes a column of data type TEXT/BLOB/etc. will allocate +LongReadLen bytes. This allocation does not leak, but if LongReadLen +is large in size, and many such row objects are created, e.g. as the +output of a ResultSet query, the memory footprint of the Perl interpreter can grow very large. The solution is to use the smallest practical value for LongReadLen. diff --git a/lib/DBIx/Class/Optional/Dependencies.pm b/lib/DBIx/Class/Optional/Dependencies.pm index 173ae32..20fe329 100644 --- a/lib/DBIx/Class/Optional/Dependencies.pm +++ b/lib/DBIx/Class/Optional/Dependencies.pm @@ -183,7 +183,7 @@ my $reqs = { test_eol => { req => { - 'Test::EOL' => '0.6', + 'Test::EOL' => '1.0', }, }, @@ -370,7 +370,7 @@ my $reqs = { title => 'Informix support', desc => 'Modules required to connect to Informix', }, - }, + }, rdbms_sqlanywhere => { req => { @@ -380,7 +380,7 @@ my $reqs = { title => 'SQLAnywhere support', desc => 'Modules required to connect to SQLAnywhere', }, - }, + }, rdbms_sqlanywhere_odbc => { req => { @@ -390,7 +390,7 @@ my $reqs = { title => 'SQLAnywhere support via DBD::ODBC', desc => 'Modules required to connect to SQLAnywhere via DBD::ODBC', }, - }, + }, rdbms_firebird => { req => { @@ -400,7 +400,7 @@ my $reqs = { title => 'Firebird support', desc => 'Modules required to connect to Firebird', }, - }, + }, rdbms_firebird_interbase => { req => { @@ -410,7 +410,7 @@ my $reqs = { title => 'Firebird support via DBD::InterBase', desc => 'Modules required to connect to Firebird via DBD::InterBase', }, - }, + }, rdbms_firebird_odbc => { req => { @@ -420,7 +420,7 @@ my $reqs = { title => 'Firebird support via DBD::ODBC', desc => 'Modules required to connect to Firebird via DBD::ODBC', }, - }, + }, # the order does matter because the rdbms support group might require # a different version that the test group diff --git a/lib/DBIx/Class/Ordered.pm b/lib/DBIx/Class/Ordered.pm index 0dd59a2..0b4384b 100644 --- a/lib/DBIx/Class/Ordered.pm +++ b/lib/DBIx/Class/Ordered.pm @@ -20,7 +20,7 @@ Create a table for your ordered data. position INTEGER NOT NULL ); -Optionally, add one or more columns to specify groupings, allowing you +Optionally, add one or more columns to specify groupings, allowing you to maintain independent ordered lists within one table: CREATE TABLE items ( @@ -40,12 +40,12 @@ Or even other_group_id INTEGER NOT NULL ); -In your Schema or DB class add "Ordered" to the top +In your Schema or DB class add "Ordered" to the top of the component list. __PACKAGE__->load_components(qw( Ordered ... )); -Specify the column that stores the position number for +Specify the column that stores the position number for each row. package My::Item; @@ -89,13 +89,13 @@ That's it, now you can change the position of your objects. =head1 DESCRIPTION -This module provides a simple interface for modifying the ordered +This module provides a simple interface for modifying the ordered position of DBIx::Class objects. =head1 AUTO UPDATE -All of the move_* methods automatically update the rows involved in -the query. This is not configurable and is due to the fact that if you +All of the move_* methods automatically update the rows involved in +the query. This is not configurable and is due to the fact that if you move a record it always causes other records in the list to be updated. =head1 METHODS @@ -104,7 +104,7 @@ move a record it always causes other records in the list to be updated. __PACKAGE__->position_column('position'); -Sets and retrieves the name of the column that stores the +Sets and retrieves the name of the column that stores the positional value of each record. Defaults to "position". =cut @@ -115,8 +115,8 @@ __PACKAGE__->mk_classdata( 'position_column' => 'position' ); __PACKAGE__->grouping_column('group_id'); -This method specifies a column to limit all queries in -this module by. This effectively allows you to have multiple +This method specifies a column to limit all queries in +this module by. This effectively allows you to have multiple ordered lists within the same table. =cut @@ -218,7 +218,7 @@ sub previous_sibling { my $sibling = $item->first_sibling(); -Returns the first sibling object, or 0 if the first sibling +Returns the first sibling object, or 0 if the first sibling is this sibling. =cut @@ -259,7 +259,7 @@ sub next_sibling { my $sibling = $item->last_sibling(); -Returns the last sibling, or 0 if the last sibling is this +Returns the last sibling, or 0 if the last sibling is this sibling. =cut @@ -415,7 +415,7 @@ group, or to the end of the group if $position is undef. 1 is returned on success, and 0 is returned if the object is already at the specified position of the specified group. -$group may be specified as a single scalar if only one +$group may be specified as a single scalar if only one grouping column is in use, or as a hashref of column => value pairs if multiple grouping columns are in use. @@ -489,8 +489,8 @@ sub move_to_group { =head2 insert -Overrides the DBIC insert() method by providing a default -position number. The default will be the number of rows in +Overrides the DBIC insert() method by providing a default +position number. The default will be the number of rows in the table +1, thus positioning the new record at the last position. =cut @@ -733,7 +733,7 @@ sub _shift_siblings { if ( $pos_is_pk or - first { $_ eq $position_column } ( map { @$_ } (values %{{ $rsrc->unique_constraints }} ) ) + first { $_ eq $position_column } ( map { @$_ } (values %{{ $rsrc->unique_constraints }} ) ) ) { my $cursor = $shift_rs->search ( {}, { order_by => { "-$ord", $position_column }, select => [$position_column, @pcols] } @@ -758,7 +758,7 @@ sub _shift_siblings { =head1 PRIVATE METHODS -These methods are used internally. You should never have the +These methods are used internally. You should never have the need to use them. =head2 _group_rs @@ -806,7 +806,7 @@ sub _position { =head2 _grouping_clause This method returns one or more name=>value pairs for limiting a search -by the grouping column(s). If the grouping column is not defined then +by the grouping column(s). If the grouping column is not defined then this will return an empty list. =cut @@ -914,17 +914,17 @@ will prevent such race conditions going undetected. =head2 Multiple Moves -Be careful when issuing move_* methods to multiple objects. If -you've pre-loaded the objects then when you move one of the objects -the position of the other object will not reflect their new value +Be careful when issuing move_* methods to multiple objects. If +you've pre-loaded the objects then when you move one of the objects +the position of the other object will not reflect their new value until you reload them from the database - see L. -There are times when you will want to move objects as groups, such -as changing the parent of several objects at once - this directly -conflicts with this problem. One solution is for us to write a -ResultSet class that supports a parent() method, for example. Another -solution is to somehow automagically modify the objects that exist +There are times when you will want to move objects as groups, such +as changing the parent of several objects at once - this directly +conflicts with this problem. One solution is for us to write a +ResultSet class that supports a parent() method, for example. Another +solution is to somehow automagically modify the objects that exist in the current object's result set to have the new position value. =head2 Default Values diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index f2c33f5..4882924 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -164,9 +164,9 @@ more info see L. =back # in a Book class (where Author has many Books) - My::DBIC::Schema::Book->belongs_to( - author => - 'My::DBIC::Schema::Author', + My::DBIC::Schema::Book->belongs_to( + author => + 'My::DBIC::Schema::Author', 'author_id' ); @@ -174,11 +174,11 @@ more info see L. My::DBIC::Schema::Book->belongs_to( author => 'My::DBIC::Schema::Author', - { 'foreign.author_id' => 'self.author_id' } + { 'foreign.author_id' => 'self.author_id' } ); # OR (similar result but uglier accessor name) - My::DBIC::Schema::Book->belongs_to( + My::DBIC::Schema::Book->belongs_to( author_id => 'My::DBIC::Schema::Author' ); @@ -203,9 +203,9 @@ declaration is shown below: # in a Book class (where Author has_many Books) __PACKAGE__->belongs_to( - author => + author => 'My::DBIC::Schema::Author', - 'author', + 'author', { join_type => 'left' } ); @@ -237,7 +237,7 @@ which can be assigned to relationships as well. Creates a one-to-many relationship where the foreign class refers to this class's primary key. This relationship refers to zero or more -records in the foreign table (e.g. a C). This relationship +records in the foreign table (e.g. a C). This relationship defaults to using the end of this classes namespace as the foreign key in C<$related_class> to resolve the join, unless C<$their_fk_column> specifies the foreign key column in C<$related_class> or C @@ -278,28 +278,28 @@ more info see L. # in an Author class (where Author has_many Books) # assuming related class is storing our PK in "author_id" My::DBIC::Schema::Author->has_many( - books => - 'My::DBIC::Schema::Book', + books => + 'My::DBIC::Schema::Book', 'author_id' ); # OR (same result) My::DBIC::Schema::Author->has_many( - books => - 'My::DBIC::Schema::Book', + books => + 'My::DBIC::Schema::Book', { 'foreign.author_id' => 'self.id' }, ); # OR (similar result, assuming related_class is storing our PK, in "author") # (the "author" is guessed at from "Author" in the class namespace) My::DBIC::Schema::Author->has_many( - books => - 'My::DBIC::Schema::Book', + books => + 'My::DBIC::Schema::Book', ); # Usage - # resultset of Books belonging to author + # resultset of Books belonging to author my $booklist = $author->books; # resultset of Books belonging to author, restricted by author name @@ -493,20 +493,20 @@ more info see L. # Every book has exactly one ISBN My::DBIC::Schema::Book->has_one( - isbn => + isbn => 'My::DBIC::Schema::ISBN', 'book_id', ); # OR (same result, assuming related_class stores our PK) My::DBIC::Schema::Book->has_one( - isbn => + isbn => 'My::DBIC::Schema::ISBN', ); # OR (same result) My::DBIC::Schema::Book->has_one( - isbn => + isbn => 'My::DBIC::Schema::ISBN', { 'foreign.book_id' => 'self.id' }, ); @@ -553,8 +553,8 @@ L. C is not strictly a relationship in its own right. Instead, it is a bridge between two resultsets which provide the same kind of convenience -accessors as true relationships provide. Although the accessor will return a -resultset or collection of objects just like has_many does, you cannot call +accessors as true relationships provide. Although the accessor will return a +resultset or collection of objects just like has_many does, you cannot call C and similar methods which operate on true relationships. =over diff --git a/lib/DBIx/Class/Relationship/Accessor.pm b/lib/DBIx/Class/Relationship/Accessor.pm index 1c73950..174aa23 100644 --- a/lib/DBIx/Class/Relationship/Accessor.pm +++ b/lib/DBIx/Class/Relationship/Accessor.pm @@ -5,7 +5,7 @@ use strict; use warnings; use Sub::Name (); -our %_pod_inherit_config = +our %_pod_inherit_config = ( class_map => { 'DBIx::Class::Relationship::Accessor' => 'DBIx::Class::Relationship' } ); diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index 8e37e1c..2b43e47 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -167,7 +167,7 @@ L and the resulting SQL will be used verbatim as the C clause of the C statement associated with this relationship. While every coderef-based condition must return a valid C clause, it may -elect to additionally return a simplified join-free condition hashref when +elect to additionally return a simplified join-free condition hashref when invoked as C<< $row_object->relationship >>, as opposed to C<< $rs->related_resultset('relationship') >>. In this case C<$row_object> is passed to the coderef as C<< $args->{self_rowobj} >>, so a user can do the diff --git a/lib/DBIx/Class/Relationship/CascadeActions.pm b/lib/DBIx/Class/Relationship/CascadeActions.pm index f6e59fa..6b5b403 100644 --- a/lib/DBIx/Class/Relationship/CascadeActions.pm +++ b/lib/DBIx/Class/Relationship/CascadeActions.pm @@ -5,7 +5,7 @@ use strict; use warnings; use DBIx::Class::Carp; -our %_pod_inherit_config = +our %_pod_inherit_config = ( class_map => { 'DBIx::Class::Relationship::CascadeActions' => 'DBIx::Class::Relationship' } ); diff --git a/lib/DBIx/Class/Relationship/ProxyMethods.pm b/lib/DBIx/Class/Relationship/ProxyMethods.pm index 5f7578a..6f204f6 100644 --- a/lib/DBIx/Class/Relationship/ProxyMethods.pm +++ b/lib/DBIx/Class/Relationship/ProxyMethods.pm @@ -6,7 +6,7 @@ use warnings; use Sub::Name (); use base qw/DBIx::Class/; -our %_pod_inherit_config = +our %_pod_inherit_config = ( class_map => { 'DBIx::Class::Relationship::ProxyMethods' => 'DBIx::Class::Relationship' } ); diff --git a/lib/DBIx/Class/ResultClass/HashRefInflator.pm b/lib/DBIx/Class/ResultClass/HashRefInflator.pm index ab7fbc7..3df5f20 100644 --- a/lib/DBIx/Class/ResultClass/HashRefInflator.pm +++ b/lib/DBIx/Class/ResultClass/HashRefInflator.pm @@ -28,7 +28,7 @@ DBIx::Class::ResultClass::HashRefInflator - Get raw hashrefs from a resultset =head1 DESCRIPTION -DBIx::Class is faster than older ORMs like Class::DBI but it still isn't +DBIx::Class is faster than older ORMs like Class::DBI but it still isn't designed primarily for speed. Sometimes you need to quickly retrieve the data from a massive resultset, while skipping the creation of fancy row objects. Specifying this class as a C for a resultset will change C<< $rs->next >> @@ -128,9 +128,9 @@ following: my $cds = $artist->cds; $cds->result_class('DBIx::Class::ResultClass::HashRefInflator'); - my $first = $cds->first; + my $first = $cds->first; -C<$first> will B be a hashref, it will be a normal CD row since +C<$first> will B be a hashref, it will be a normal CD row since HashRefInflator only affects resultsets at inflation time, and prefetch causes relations to be inflated when the master C<$artist> row is inflated. diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index d883551..7097d64 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -446,7 +446,7 @@ sub _normalize_selection { $attrs->{'+columns'} = $self->_merge_attr($attrs->{'+columns'}, delete $attrs->{include_columns}) if exists $attrs->{include_columns}; - # columns are always placed first, however + # columns are always placed first, however # Keep the X vs +X separation until _resolved_attrs time - this allows to # delay the decision on whether to use a default select list ($rsrc->columns) @@ -1991,7 +1991,7 @@ sub populate { push(@created, $self->create($item)); } return wantarray ? @created : \@created; - } + } else { my $first = $data->[0]; @@ -2720,7 +2720,7 @@ supplied by the database (e.g. an auto_increment primary key column). In normal usage, the value of such columns should NOT be included at all in the call to C, even when set to C. -See also L, L and L. +See also L, L and L. =cut diff --git a/lib/DBIx/Class/ResultSetColumn.pm b/lib/DBIx/Class/ResultSetColumn.pm index e97355e..49adce9 100644 --- a/lib/DBIx/Class/ResultSetColumn.pm +++ b/lib/DBIx/Class/ResultSetColumn.pm @@ -61,14 +61,14 @@ sub new { # analyze the order_by, and see if it is done over a function/nonexistentcolumn # if this is the case we will need to wrap a subquery since the result of RSC # *must* be a single column select - my %collist = map + my %collist = map { $_ => 1, ($_ =~ /\./) ? () : ( "$alias.$_" => 1 ) } ($rs->result_source->columns, $column) ; if ( scalar grep { ! $collist{$_->[0]} } - ( $rs->result_source->schema->storage->_extract_order_criteria ($orig_attrs->{order_by} ) ) + ( $rs->result_source->schema->storage->_extract_order_criteria ($orig_attrs->{order_by} ) ) ) { # nuke the prefetch before collapsing to sql my $subq_rs = $rs->search; @@ -149,7 +149,7 @@ sub as_query { return shift->_resultset->as_query(@_) } Returns the next value of the column in the resultset (or C if there is none). -Much like L but just returning the +Much like L but just returning the one value. =cut @@ -441,7 +441,7 @@ sub func_rs { See L for details. -=cut +=cut sub throw_exception { my $self=shift; diff --git a/lib/DBIx/Class/ResultSource/View.pm b/lib/DBIx/Class/ResultSource/View.pm index 9c0d51a..232cc2f 100644 --- a/lib/DBIx/Class/ResultSource/View.pm +++ b/lib/DBIx/Class/ResultSource/View.pm @@ -106,7 +106,7 @@ You could now say: $schema->resultset('Year2000CDs')->all(); - SELECT cdid, artist, title FROM + SELECT cdid, artist, title FROM (SELECT cdid, artist, title FROM cd WHERE year ='2000') me =back @@ -129,7 +129,7 @@ database-based view. An SQL query for your view. Will not be translated across database syntaxes. -=head2 deploy_depends_on +=head2 deploy_depends_on __PACKAGE__->result_source_instance->deploy_depends_on( ["MyApp::Schema::Result::Year","MyApp::Schema::Result::CD"] diff --git a/lib/DBIx/Class/ResultSourceHandle.pm b/lib/DBIx/Class/ResultSourceHandle.pm index 690fe21..e0dbd08 100644 --- a/lib/DBIx/Class/ResultSourceHandle.pm +++ b/lib/DBIx/Class/ResultSourceHandle.pm @@ -98,7 +98,7 @@ sub STORABLE_freeze { =head2 STORABLE_thaw Thaws frozen handle. Resets the internal schema reference to the package -variable C<$thaw_schema>. The recommended way of setting this is to use +variable C<$thaw_schema>. The recommended way of setting this is to use C<< $schema->thaw($ice) >> which handles this for you. =cut diff --git a/lib/DBIx/Class/SQLMaker/LimitDialects.pm b/lib/DBIx/Class/SQLMaker/LimitDialects.pm index 8e85ac8..6469bb0 100644 --- a/lib/DBIx/Class/SQLMaker/LimitDialects.pm +++ b/lib/DBIx/Class/SQLMaker/LimitDialects.pm @@ -682,7 +682,7 @@ $order_sql # # Returns mangled proto-sql, inner/outer strings of SQL QUOTED selectors # with aliases (to be used in whatever select statement), and an alias -# index hashref of QUOTED SEL => QUOTED ALIAS pairs (to maybe be used +# index hashref of QUOTED SEL => QUOTED ALIAS pairs (to maybe be used # for string-subst higher up). # If an order_by is supplied, the inner select needs to bring out columns # used in implicit (non-selected) orders, and the order condition itself diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 847c8a1..b9d7489 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1360,7 +1360,7 @@ sub txn_commit { # as a new txn is started immediately on commit $self->transaction_depth(1) if ( !$self->transaction_depth - and + and defined $self->_dbh_autocommit and ! $self->_dbh_autocommit @@ -1391,7 +1391,7 @@ sub txn_rollback { # as a new txn is started immediately on commit $self->transaction_depth(1) if ( !$self->transaction_depth - and + and defined $self->_dbh_autocommit and ! $self->_dbh_autocommit @@ -2879,7 +2879,7 @@ sub _max_column_bytesize { if ($data_type =~ /^(?: l? (?:var)? char(?:acter)? (?:\s*varying)? | - (?:var)? binary (?:\s*varying)? + (?:var)? binary (?:\s*varying)? | raw )\b/x diff --git a/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm b/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm index 30d7299..a0a5586 100644 --- a/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm +++ b/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm @@ -6,7 +6,7 @@ use warnings; use base 'DBIx::Class::Storage::DBI'; use mro 'c3'; -=head1 NAME +=head1 NAME DBIx::Class::Storage::DBI::MultiColumnIn - Storage component for RDBMS supporting multicolumn in clauses @@ -29,7 +29,7 @@ sub _multipk_update_delete { my @pcols = $rsrc->_pri_cols; my $attrs = $rs->_resolved_attrs; - # naive check - this is an internal method after all, we should know what we are doing + # naive check - this is an internal method after all, we should know what we are doing $self->throw_exception ('Number of columns selected by supplied resultset does not match number of primary keys') if ( ref $attrs->{select} ne 'ARRAY' or @{$attrs->{select}} != @pcols ); diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/SQL_Anywhere.pm b/lib/DBIx/Class/Storage/DBI/ODBC/SQL_Anywhere.pm index 03a1afe..d40029e 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/SQL_Anywhere.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/SQL_Anywhere.pm @@ -22,7 +22,7 @@ that module for details. =head2 uniqueidentifierstr data type If you use the C type with this driver, your queries may -fail with: +fail with: Data truncated (SQL-01004) diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index df7053a..256bbc9 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -709,7 +709,7 @@ and child rows of the hierarchy. # person me # CONNECT BY # parentid = prior persionid - + connect_by_nocycle => { parentid => 'prior personid' } diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm b/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm index 7b57972..82d3b6a 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated/Balancer.pm @@ -9,7 +9,7 @@ use namespace::clean -except => 'meta'; =head1 NAME -DBIx::Class::Storage::DBI::Replicated::Balancer - A Software Load Balancer +DBIx::Class::Storage::DBI::Replicated::Balancer - A Software Load Balancer =head1 SYNOPSIS @@ -71,7 +71,7 @@ has 'pool' => ( Replicant storages (slaves) handle all read only traffic. The assumption is that your database will become readbound well before it becomes write bound -and that being able to spread your read only traffic around to multiple +and that being able to spread your read only traffic around to multiple databases is going to help you to scale traffic. This attribute returns the next slave to handle a read request. Your L @@ -111,8 +111,8 @@ sub _build_current_replicant { This method should be defined in the class which consumes this role. Given a pool object, return the next replicant that will serve queries. The -default behavior is to grab the first replicant it finds but you can write -your own subclasses of L to +default behavior is to grab the first replicant it finds but you can write +your own subclasses of L to support other balance systems. This returns from the pool of active replicants. If there are no active @@ -136,9 +136,9 @@ around 'next_storage' => sub { ## Do we need to validate the replicants? if( - $self->has_auto_validate_every && + $self->has_auto_validate_every && ($self->auto_validate_every + $self->pool->last_validated) <= $now - ) { + ) { $self->pool->validate_replicants; } @@ -180,7 +180,7 @@ around 'select' => sub { if (my $forced_pool = $args[-1]->{force_pool}) { delete $args[-1]->{force_pool}; - return $self->_get_forced_pool($forced_pool)->select(@args); + return $self->_get_forced_pool($forced_pool)->select(@args); } elsif($self->master->{transaction_depth}) { return $self->master->select(@args); } else { @@ -202,7 +202,7 @@ around 'select_single' => sub { if (my $forced_pool = $args[-1]->{force_pool}) { delete $args[-1]->{force_pool}; - return $self->_get_forced_pool($forced_pool)->select_single(@args); + return $self->_get_forced_pool($forced_pool)->select_single(@args); } elsif($self->master->{transaction_depth}) { return $self->master->select_single(@args); } else { @@ -240,7 +240,7 @@ sub _get_forced_pool { return $replicant; } else { $self->master->throw_exception("$forced_pool is not a named replicant."); - } + } } =head1 AUTHOR diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/Introduction.pod b/lib/DBIx/Class/Storage/DBI/Replicated/Introduction.pod index 6216be4..0b49b98 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/Introduction.pod +++ b/lib/DBIx/Class/Storage/DBI/Replicated/Introduction.pod @@ -12,11 +12,11 @@ This document is not an overview of what replication is or why you should be using it. It is not a document explaining how to setup MySQL native replication either. Copious external resources are available for both. This document presumes you have the basics down. - + =head1 DESCRIPTION L supports a framework for using database replication. This system -is integrated completely, which means once it's setup you should be able to +is integrated completely, which means once it's setup you should be able to automatically just start using a replication cluster without additional work or changes to your code. Some caveats apply, primarily related to the proper use of transactions (you are wrapping all your database modifying statements inside @@ -34,7 +34,7 @@ For an easy way to start playing with MySQL native replication, see: L. If you are using this with a L based application, you may also want -to see more recent updates to L, which has +to see more recent updates to L, which has support for replication configuration options as well. =head1 REPLICATED STORAGE @@ -43,16 +43,16 @@ By default, when you start L, your Schema (L) is assigned a storage_type, which when fully connected will reflect your underlying storage engine as defined by your chosen database driver. For example, if you connect to a MySQL database, your storage_type will be -L Your storage type class will contain +L Your storage type class will contain database specific code to help smooth over the differences between databases and let L do its thing. If you want to use replication, you will override this setting so that the -replicated storage engine will 'wrap' your underlying storages and present +replicated storage engine will 'wrap' your underlying storages and present a unified interface to the end programmer. This wrapper storage class will delegate method calls to either a master database or one or more replicated databases based on if they are read only (by default sent to the replicants) -or write (reserved for the master). Additionally, the Replicated storage +or write (reserved for the master). Additionally, the Replicated storage will monitor the health of your replicants and automatically drop them should one exceed configurable parameters. Later, it can automatically restore a replicant when its health is restored. @@ -64,7 +64,7 @@ Additionally, if you need high data integrity, such as when you are executing a transaction, replicated storage will automatically delegate all database traffic to the master storage. There are several ways to enable this high integrity mode, but wrapping your statements inside a transaction is the easy -and canonical option. +and canonical option. =head1 PARTS OF REPLICATED STORAGE @@ -131,7 +131,7 @@ one that makes sense. 'balancer_args' get passed to the balancer when it's instantiated. All balancers have the 'auto_validate_every' option. This is the number of seconds we allow to pass between validation checks on a load balanced replicant. So -the higher the number, the more possibility that your reads to the replicant +the higher the number, the more possibility that your reads to the replicant may be inconsistent with what's on the master. Setting this number too low will result in increased database loads, so choose a number with care. Our experience is that setting the number around 5 seconds results in a good diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm b/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm index b1e8d38..8b15016 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm @@ -23,7 +23,7 @@ shouldn't need to create instances of this class. =head1 DESCRIPTION In a replicated storage type, there is at least one replicant to handle the -read-only traffic. The Pool class manages this replicant, or list of +read-only traffic. The Pool class manages this replicant, or list of replicants, and gives some methods for querying information about their status. =head1 ATTRIBUTES @@ -81,7 +81,7 @@ has 'replicant_type' => ( default=>'DBIx::Class::Storage::DBI', handles=>{ 'create_replicant' => 'new', - }, + }, ); =head2 replicants @@ -219,7 +219,7 @@ sub connect_replicants { } $replicant->id($key); - $self->set_replicant($key => $replicant); + $self->set_replicant($key => $replicant); push @newly_created, $replicant; } @@ -395,9 +395,9 @@ sub validate_replicants { if($lag_behind_master <= $self->maximum_lag) { $replicant->active(1); } else { - $replicant->active(0); + $replicant->active(0); } - } + } } else { $replicant->active(0); } @@ -406,8 +406,8 @@ sub validate_replicants { $replicant->active(0); } } - ## Mark that we completed this validation. - $self->_last_validated(time); + ## Mark that we completed this validation. + $self->_last_validated(time); } =head1 AUTHOR diff --git a/lib/DBIx/Class/Storage/DBI/SQLite.pm b/lib/DBIx/Class/Storage/DBI/SQLite.pm index a050797..f06f878 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLite.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLite.pm @@ -142,7 +142,7 @@ In L to turn on foreign key Executes: - PRAGMA foreign_keys = ON + PRAGMA foreign_keys = ON See L for more information. diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm index 5911981..b0cdb2d 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm @@ -124,7 +124,7 @@ package # hide from PAUSE DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::DateTime::Format; my $datetime_parse_format = '%Y-%m-%dT%H:%M:%S.%3NZ'; -my $datetime_format_format = '%Y-%m-%d %H:%M:%S.%3N'; # %F %T +my $datetime_format_format = '%Y-%m-%d %H:%M:%S.%3N'; # %F %T my ($datetime_parser, $datetime_formatter); diff --git a/lib/DBIx/Class/Storage/DBI/mysql.pm b/lib/DBIx/Class/Storage/DBI/mysql.pm index 962f6bd..35ff42a 100644 --- a/lib/DBIx/Class/Storage/DBI/mysql.pm +++ b/lib/DBIx/Class/Storage/DBI/mysql.pm @@ -79,7 +79,7 @@ sub deployment_statements { if ( ! exists $sqltargs->{producer_args}{mysql_version} - and + and my $dver = $self->_server_info->{normalized_dbms_version} ) { $sqltargs->{producer_args}{mysql_version} = $dver; diff --git a/lib/DBIx/Class/Storage/DBIHacks.pm b/lib/DBIx/Class/Storage/DBIHacks.pm index 35276d4..8272496 100644 --- a/lib/DBIx/Class/Storage/DBIHacks.pm +++ b/lib/DBIx/Class/Storage/DBIHacks.pm @@ -61,7 +61,7 @@ sub _prune_unused_joins { # # This is the code producing joined subqueries like: -# SELECT me.*, other.* FROM ( SELECT me.* FROM ... ) JOIN other ON ... +# SELECT me.*, other.* FROM ( SELECT me.* FROM ... ) JOIN other ON ... # sub _adjust_select_args_for_complex_prefetch { my ($self, $from, $select, $where, $attrs) = @_; @@ -569,7 +569,7 @@ sub _inner_join_to_node { # So it looks like we will have to switch some stuff around. # local() is useless here as we will be leaving the scope # anyway, and deep cloning is just too fucking expensive - # So replace the first hashref in the node arrayref manually + # So replace the first hashref in the node arrayref manually my @new_from = ($from->[0]); my $sw_idx = { map { (values %$_), 1 } @$switch_branch }; #there's one k/v per join-path diff --git a/lib/DBIx/Class/UTF8Columns.pm b/lib/DBIx/Class/UTF8Columns.pm index 4e52add..a26dcdc 100644 --- a/lib/DBIx/Class/UTF8Columns.pm +++ b/lib/DBIx/Class/UTF8Columns.pm @@ -54,7 +54,7 @@ this module anyway as Unicode is properly supported by all major database engines, as explained below. If you have specific questions about the integrity of your data in light -of this development - please +of this development - please L to further discuss your concerns with the team. diff --git a/t/101populate_rs.t b/t/101populate_rs.t index 6caf01e..5de0b4f 100644 --- a/t/101populate_rs.t +++ b/t/101populate_rs.t @@ -66,17 +66,17 @@ SCHEMA_POPULATE1: { isa_ok $artist1, 'DBICTest::Artist'; isa_ok $artist2, 'DBICTest::Artist'; isa_ok $artist3, 'DBICTest::Artist'; - isa_ok $undef, 'DBICTest::Artist'; + isa_ok $undef, 'DBICTest::Artist'; ok $artist1->name eq '001First Artist', "Got Expected Artist Name for Artist001"; ok $artist2->name eq '002Second Artist', "Got Expected Artist Name for Artist002"; ok $artist3->name eq '003Third Artist', "Got Expected Artist Name for Artist003"; - ok !defined $undef->name, "Got Expected Artist Name for Artist004"; + ok !defined $undef->name, "Got Expected Artist Name for Artist004"; ok $artist1->cds->count eq 3, "Got Right number of CDs for Artist1"; ok $artist2->cds->count eq 0, "Got Right number of CDs for Artist2"; ok $artist3->cds->count eq 1, "Got Right number of CDs for Artist3"; - ok $undef->cds->count eq 1, "Got Right number of CDs for Artist4"; + ok $undef->cds->count eq 1, "Got Right number of CDs for Artist4"; ARTIST1CDS: { @@ -170,7 +170,7 @@ ARRAY_CONTEXT: { isa_ok( $crap, 'DBICTest::Artist', "Got 'Artist'"); isa_ok( $girl, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); isa_ok( $formerly, 'DBICTest::Artist', "Got 'Artist'"); ## Find the expected information? @@ -244,7 +244,7 @@ ARRAY_CONTEXT: { isa_ok( $crap, 'DBICTest::Artist', "Got 'Artist'"); isa_ok( $girl, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); isa_ok( $formerly, 'DBICTest::Artist', "Got 'Artist'"); ## Find the expected information? @@ -258,7 +258,7 @@ ARRAY_CONTEXT: { ## Create the expected children sub objects? ok( $crap->cds->count == 0, "got Expected Number of Cds"); - ok( $girl->cds->count == 2, "got Expected Number of Cds"); + ok( $girl->cds->count == 2, "got Expected Number of Cds"); ok( $damn->cds->count == 3, "got Expected Number of Cds"); ok( $formerly->cds->count == 1, "got Expected Number of Cds"); @@ -272,7 +272,7 @@ ARRAY_CONTEXT: { BELONGS_TO_NO_PKs: { - ## Test from a belongs_to perspective, should create artist first, + ## Test from a belongs_to perspective, should create artist first, ## then CD with artistid. This test we let the system automatically ## create the PK's. Chances are good you'll use it this way mostly. @@ -286,7 +286,7 @@ ARRAY_CONTEXT: { title => 'Some CD4', year => '1997', artist => { name => 'Fred BloggsD'}, - }, + }, ]; my ($cdA, $cdB) = $cd_rs->populate($cds); @@ -304,7 +304,7 @@ ARRAY_CONTEXT: { BELONGS_TO_WITH_PKs: { - ## Test from a belongs_to perspective, should create artist first, + ## Test from a belongs_to perspective, should create artist first, ## then CD with artistid. This time we try setting the PK's my $aid = $art_rs->get_column('artistid')->max || 0; @@ -319,7 +319,7 @@ ARRAY_CONTEXT: { title => 'Some CD4', year => '1997', artist => { artistid=> ++$aid, name => 'Fred BloggsF'}, - }, + }, ]; my ($cdA, $cdB) = $cd_rs->populate($cds); @@ -344,7 +344,7 @@ ARRAY_CONTEXT: { ## Did it use the condition in the resultset? cmp_ok( $more_crap->rank, '==', 42, "Got Correct rank for result object"); - } + } } @@ -354,7 +354,7 @@ ARRAY_CONTEXT: { VOID_CONTEXT: { - ## All these tests check the ability to use populate without asking for + ## All these tests check the ability to use populate without asking for ## any returned resultsets. This uses bulk_insert as much as possible ## in order to increase speed. @@ -386,7 +386,7 @@ VOID_CONTEXT: { cds => [ { title => 'VOID_PK_My parents sold me to a record company' ,year => 2005 }, { title => 'VOID_PK_Why Am I So Ugly?', year => 2006 }, - { title => 'VOID_PK_I Got Surgery and am now Popular', year => 2007 } + { title => 'VOID_PK_I Got Surgery and am now Popular', year => 2007 } ], }, { @@ -419,27 +419,27 @@ VOID_CONTEXT: { isa_ok( $crap, 'DBICTest::Artist', "Got 'Artist'"); isa_ok( $girl, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $formerly, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $undef, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $formerly, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $undef, 'DBICTest::Artist', "Got 'Artist'"); ## Find the expected information? ok( $crap->name eq 'VOID_PK_Manufactured Crap', "Got Correct name 'VOID_PK_Manufactured Crap' for result object"); ok( $girl->name eq 'VOID_PK_Angsty-Whiny Girl', "Got Correct name for result object"); - ok( $damn->name eq 'VOID_PK_Like I Give a Damn', "Got Correct name for result object"); + ok( $damn->name eq 'VOID_PK_Like I Give a Damn', "Got Correct name for result object"); ok( $formerly->name eq 'VOID_PK_Formerly Named', "Got Correct name for result object"); - ok( !defined $undef->name, "Got Correct name 'is undef' for result object"); + ok( !defined $undef->name, "Got Correct name 'is undef' for result object"); ## Create the expected children sub objects? ok( $crap->can('cds'), "Has cds relationship"); ok( $girl->can('cds'), "Has cds relationship"); ok( $damn->can('cds'), "Has cds relationship"); ok( $formerly->can('cds'), "Has cds relationship"); - ok( $undef->can('cds'), "Has cds relationship"); + ok( $undef->can('cds'), "Has cds relationship"); ok( $crap->cds->count == 0, "got Expected Number of Cds"); - ok( $girl->cds->count == 2, "got Expected Number of Cds"); + ok( $girl->cds->count == 2, "got Expected Number of Cds"); ok( $damn->cds->count == 3, "got Expected Number of Cds"); ok( $formerly->cds->count == 1, "got Expected Number of Cds"); ok( $undef->cds->count == 1, "got Expected Number of Cds"); @@ -455,7 +455,7 @@ VOID_CONTEXT: { BELONGS_TO_WITH_PKs: { - ## Test from a belongs_to perspective, should create artist first, + ## Test from a belongs_to perspective, should create artist first, ## then CD with artistid. This time we try setting the PK's my $aid = $art_rs->get_column('artistid')->max || 0; @@ -492,7 +492,7 @@ VOID_CONTEXT: { BELONGS_TO_NO_PKs: { - ## Test from a belongs_to perspective, should create artist first, + ## Test from a belongs_to perspective, should create artist first, ## then CD with artistid. my $cds = [ @@ -510,7 +510,7 @@ VOID_CONTEXT: { title => 'Some CD5BB', year => '1997', artist => { name => undef}, - }, + }, ]; $cd_rs->populate($cds); @@ -543,13 +543,13 @@ VOID_CONTEXT: { ## with the parent having many children and let the keys be automatic my $artists = [ - { + { name => 'VOID_Angsty-Whiny Girl', cds => [ { title => 'VOID_My First CD', year => 2006 }, { title => 'VOID_Yet More Tweeny-Pop crap', year => 2007 }, - ], - }, + ], + }, { name => 'VOID_Manufactured Crap', }, @@ -558,15 +558,15 @@ VOID_CONTEXT: { cds => [ { title => 'VOID_My parents sold me to a record company' ,year => 2005 }, { title => 'VOID_Why Am I So Ugly?', year => 2006 }, - { title => 'VOID_I Got Surgery and am now Popular', year => 2007 } + { title => 'VOID_I Got Surgery and am now Popular', year => 2007 } ], }, - { + { name => 'VOID_Formerly Named', cds => [ { title => 'VOID_One Hit Wonder', year => 2006 }, - ], - }, + ], + }, ]; ## Get the result row objects. @@ -582,14 +582,14 @@ VOID_CONTEXT: { isa_ok( $crap, 'DBICTest::Artist', "Got 'Artist'"); isa_ok( $girl, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); - isa_ok( $formerly, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $damn, 'DBICTest::Artist', "Got 'Artist'"); + isa_ok( $formerly, 'DBICTest::Artist', "Got 'Artist'"); ## Find the expected information? ok( $crap->name eq 'VOID_Manufactured Crap', "Got Correct name for result object"); ok( $girl->name eq 'VOID_Angsty-Whiny Girl', "Got Correct name for result object"); - ok( $damn->name eq 'VOID_Like I Give a Damn', "Got Correct name for result object"); + ok( $damn->name eq 'VOID_Like I Give a Damn', "Got Correct name for result object"); ok( $formerly->name eq 'VOID_Formerly Named', "Got Correct name for result object"); ## Create the expected children sub objects? @@ -599,7 +599,7 @@ VOID_CONTEXT: { ok( $formerly->can('cds'), "Has cds relationship"); ok( $crap->cds->count == 0, "got Expected Number of Cds"); - ok( $girl->cds->count == 2, "got Expected Number of Cds"); + ok( $girl->cds->count == 2, "got Expected Number of Cds"); ok( $damn->cds->count == 3, "got Expected Number of Cds"); ok( $formerly->cds->count == 1, "got Expected Number of Cds"); @@ -627,7 +627,7 @@ VOID_CONTEXT: { ## Did it use the condition in the resultset? cmp_ok( $more_crap->rank, '==', 42, "Got Correct rank for result object"); - } + } } ARRAYREF_OF_ARRAYREF_STYLE: { @@ -649,11 +649,11 @@ ARRAYREF_OF_ARRAYREF_STYLE: { my ($cooler, $lamer) = $restricted_art_rs->populate([ [qw/artistid name/], [1003, 'Cooler'], - [1004, 'Lamer'], + [1004, 'Lamer'], ]); is $cooler->name, 'Cooler', 'Correct Name'; - is $lamer->name, 'Lamer', 'Correct Name'; + is $lamer->name, 'Lamer', 'Correct Name'; cmp_ok $cooler->rank, '==', 42, 'Correct Rank'; @@ -667,7 +667,7 @@ ARRAYREF_OF_ARRAYREF_STYLE: { ## Did it use the condition in the resultset? cmp_ok( $mega_lamer->rank, '==', 42, "Got Correct rank for result object"); - } + } VOID_CONTEXT_WITH_COND_FROM_RS: { diff --git a/t/103many_to_many_warning.t b/t/103many_to_many_warning.t index 36d41a8..0cd054b 100644 --- a/t/103many_to_many_warning.t +++ b/t/103many_to_many_warning.t @@ -8,7 +8,7 @@ plan tests => 4; my $exp_warn = qr/The many-to-many relationship 'bars' is trying to create/; { - my @w; + my @w; local $SIG{__WARN__} = sub { $_[0] =~ $exp_warn ? push @w, $_[0] : warn $_[0] }; my $code = gen_code ( suffix => 1 ); eval "$code"; @@ -19,7 +19,7 @@ my $exp_warn = qr/The many-to-many relationship 'bars' is trying to create/; } { - my @w; + my @w; local $SIG{__WARN__} = sub { $_[0] =~ $exp_warn ? push @w, $_[0] : warn $_[0] }; my $code = gen_code ( suffix => 2 ); diff --git a/t/105view_deps.t b/t/105view_deps.t index 6a40e20..284fb4a 100644 --- a/t/105view_deps.t +++ b/t/105view_deps.t @@ -54,7 +54,7 @@ can_ok( $view, $_ ) for qw/new from deploy_depends_on/; aba_name_artists aba_name_artists_and_2010_cds_with_many_tracks /], - "SQLT view order triumphantly matches our order." + "SQLT view order triumphantly matches our order." ); #################### AND WHAT ABOUT USING THE SCHEMA? @@ -94,7 +94,7 @@ can_ok( $view, $_ ) for qw/new from deploy_depends_on/; aba_name_artists_and_2010_cds_with_many_tracks aba_name_artists /], - "SQLT view order triumphantly matches our order." + "SQLT view order triumphantly matches our order." ); #################### AND WHAT ABOUT USING THE SCHEMA2? diff --git a/t/39load_namespaces_rt41083.t b/t/39load_namespaces_rt41083.t index 05378c8..79c9c7a 100644 --- a/t/39load_namespaces_rt41083.t +++ b/t/39load_namespaces_rt41083.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use DBICTest; # do not remove even though it is not used +use DBICTest; # do not remove even though it is not used use Test::More tests => 8; sub _chk_warning { diff --git a/t/53lean_startup.t b/t/53lean_startup.t index 072eac3..7e81af2 100644 --- a/t/53lean_startup.t +++ b/t/53lean_startup.t @@ -91,7 +91,7 @@ BEGIN { ) { fail ("Unexpected require of '$req' by $caller[0] ($caller[1] line $caller[2])"); - if ($ENV{TEST_VERBOSE}) { + if ($ENV{TEST_VERBOSE}) { my ($i, @stack) = 1; while (my @f = caller($i++) ) { push @stack, \@f; diff --git a/t/60core.t b/t/60core.t index d2582f4..edf5758 100644 --- a/t/60core.t +++ b/t/60core.t @@ -106,7 +106,7 @@ is($new_again->name, 'Man With A Spoon', 'Retrieved correctly'); is($new_again->ID, 'DBICTest::Artist|artist|artistid=4', 'unique object id generated correctly'); -# test that store_column is called once for create() for non sequence columns +# test that store_column is called once for create() for non sequence columns { ok(my $artist = $schema->resultset('Artist')->create({name => 'store_column test'})); is($artist->name, 'X store_column test'); # used to be 'X X store...' @@ -284,7 +284,7 @@ warnings_exist (sub { group_by => [ qw/position title/ ] } ); - is($tcount->count, 13, 'multiple column COUNT DISTINCT using column syntax ok'); + is($tcount->count, 13, 'multiple column COUNT DISTINCT using column syntax ok'); } my $tag_rs = $schema->resultset('Tag')->search( @@ -335,7 +335,7 @@ ok($schema->storage(), 'Storage available'); my @artsn = $schema->resultset('SourceNameArtists')->search({}, { order_by => 'name DESC' }); is(@artsn, 4, "Four artists returned"); - + # make sure subclasses that don't set source_name are ok ok($schema->source('ArtistSubclass'), 'ArtistSubclass exists'); } diff --git a/t/63register_class.t b/t/63register_class.t index e9053a3..6370464 100644 --- a/t/63register_class.t +++ b/t/63register_class.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More tests => 2; use lib qw(t/lib); diff --git a/t/63register_column.t b/t/63register_column.t index 49d37bb..21de95d 100644 --- a/t/63register_column.t +++ b/t/63register_column.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; diff --git a/t/64db.t b/t/64db.t index ebe22f1..d1284f8 100644 --- a/t/64db.t +++ b/t/64db.t @@ -13,7 +13,7 @@ plan tests => 4; # XXX: Is storage->dbh the only way to get a dbh? $schema->storage->txn_begin; for (10..15) { - $schema->resultset("Artist")->create( { + $schema->resultset("Artist")->create( { artistid => $_, name => "artist number $_", } ); diff --git a/t/65multipk.t b/t/65multipk.t index 45c9b2f..cd0e108 100644 --- a/t/65multipk.t +++ b/t/65multipk.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/67pager.t b/t/67pager.t index eb17faa..406cd40 100644 --- a/t/67pager.t +++ b/t/67pager.t @@ -112,7 +112,7 @@ $it = $rs->search({}, { }); my $row = $rs->search({}, { - order_by => 'cdid', + order_by => 'cdid', offset => 3, rows => 1 })->single; diff --git a/t/69update.t b/t/69update.t index 8b6fc28..ea1eaae 100644 --- a/t/69update.t +++ b/t/69update.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/70auto.t b/t/70auto.t index 440c943..839c807 100644 --- a/t/70auto.t +++ b/t/70auto.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/71mysql.t b/t/71mysql.t index f78948c..3ed8493 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -52,7 +52,7 @@ $dbh->do("CREATE TABLE books (id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, so #'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', ''); -# make sure sqlt_type overrides work (::Storage::DBI::mysql does this) +# make sure sqlt_type overrides work (::Storage::DBI::mysql does this) { my $schema = DBICTest::Schema->connect($dsn, $user, $pass); @@ -144,7 +144,7 @@ $schema->populate ('BooksInLibrary', [ ]); # -# try a distinct + prefetch on tables with identically named columns +# try a distinct + prefetch on tables with identically named columns # (mysql doesn't seem to like subqueries with equally named columns) # @@ -338,7 +338,7 @@ ZEROINSEARCH: { 'Zero-year groups successfully', ); - # convoluted search taken verbatim from list + # convoluted search taken verbatim from list my $restrict_rs = $rs->search({ -and => [ year => { '!=', 0 }, year => { '!=', undef } diff --git a/t/72pg.t b/t/72pg.t index 5596fd2..f3250ed 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -435,7 +435,7 @@ lives_ok { $cds->update({ year => '2010' }) } 'Update on prefetched rs'; } 'with_deferred_fk_checks code survived'; is eval { $schema->resultset('Track')->find(999)->title }, 'deferred FK track', - 'code in with_deferred_fk_checks worked'; + 'code in with_deferred_fk_checks worked'; throws_ok { $schema->resultset('Track')->create({ diff --git a/t/746db2_400.t b/t/746db2_400.t index 29d16e1..b3c55eb 100644 --- a/t/746db2_400.t +++ b/t/746db2_400.t @@ -76,7 +76,7 @@ my $test_type_info = { 'charfield' => { 'data_type' => 'CHAR', 'is_nullable' => 1, - 'size' => 10 + 'size' => 10 }, }; diff --git a/t/746mssql.t b/t/746mssql.t index 620258e..6557d49 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -538,7 +538,7 @@ SQL if $opts_name eq 'use_dynamic_cursors' && $schema->storage->using_freetds; - local $TODO = + local $TODO = 'these tests fail on freetds with dynamic cursors for some reason' if $freetds_and_dynamic_cursors; local $ENV{DBIC_NULLABLE_KEY_NOWARN} = 1 diff --git a/t/746sybase.t b/t/746sybase.t index 7fcffb4..b82138b 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -348,7 +348,7 @@ SQL eval { $dbh->do('DROP TABLE bindtype_test') }; $dbh->do(qq[ - CREATE TABLE bindtype_test + CREATE TABLE bindtype_test ( id INT IDENTITY PRIMARY KEY, bytea IMAGE NULL, @@ -363,7 +363,7 @@ SQL $binstr{'large'} = $binstr{'small'} x 1024; my $maxloblen = length $binstr{'large'}; - + if (not $schema->storage->using_freetds) { $dbh->{'LongReadLen'} = $maxloblen * 2; } else { @@ -589,7 +589,7 @@ CREATE TABLE computed_column_test ( id INT IDENTITY PRIMARY KEY, a_computed_column AS getdate(), a_timestamp timestamp, - charfield VARCHAR(20) DEFAULT 'foo' + charfield VARCHAR(20) DEFAULT 'foo' ) SQL }); diff --git a/t/748informix.t b/t/748informix.t index ad21c2e..11204b9 100644 --- a/t/748informix.t +++ b/t/748informix.t @@ -133,7 +133,7 @@ lives_ok { } 'with_deferred_fk_checks code survived'; is eval { $schema->resultset('Track')->find(999)->title }, 'deferred FK track', - 'code in with_deferred_fk_checks worked'; + 'code in with_deferred_fk_checks worked'; throws_ok { $schema->resultset('Track')->create({ diff --git a/t/749sqlanywhere.t b/t/749sqlanywhere.t index 816186e..a0e55f9 100644 --- a/t/749sqlanywhere.t +++ b/t/749sqlanywhere.t @@ -177,7 +177,7 @@ EOF ok($rs->find($id)->$type eq $binstr{$size}, "verified inserted $size $type" ); } } - + my @uuid_types = qw/uniqueidentifier uniqueidentifierstr/; # test uniqueidentifiers (and the cursor_class). diff --git a/t/75limit.t b/t/75limit.t index 686161a..61f5520 100644 --- a/t/75limit.t +++ b/t/75limit.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); @@ -59,7 +59,7 @@ is( $cds[0]->title, "Spoonful of bees", "offset with no limit" ); # requires SQL::Abstract >= 1.20 $it = $schema->resultset("CD")->search( { title => [ - -and => + -and => { -like => '%bees' }, diff --git a/t/76joins.t b/t/76joins.t index a110ec2..b0d92f8 100644 --- a/t/76joins.t +++ b/t/76joins.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); @@ -167,7 +167,7 @@ is($rs->first->name, 'We Are Goth', 'Correct record returned'); [ 4, 7 ], [ 4, 8 ], ]); - + sub cd_count { return $schema->resultset("CD")->count; } @@ -177,7 +177,7 @@ is($rs->first->name, 'We Are Goth', 'Correct record returned'); is(cd_count(), 8, '8 rows in table cd'); is(tk_count(), 7, '7 rows in table twokeys'); - + sub artist1 { return $schema->resultset("CD")->search( { 'artist.name' => 'Caterwauler McCrae' }, diff --git a/t/78self_referencial.t b/t/78self_referencial.t index 640cbc2..a02677d 100644 --- a/t/78self_referencial.t +++ b/t/78self_referencial.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/79aliasing.t b/t/79aliasing.t index 4f9b3a3..00e5e93 100644 --- a/t/79aliasing.t +++ b/t/79aliasing.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/83cache.t b/t/83cache.t index 2f4c036..5fd25d3 100644 --- a/t/83cache.t +++ b/t/83cache.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/86might_have.t b/t/86might_have.t index a375404..c1a66de 100644 --- a/t/86might_have.t +++ b/t/86might_have.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Warn; @@ -21,7 +21,7 @@ $schema->storage->debug(1); $cd->update; -is($queries, 1, 'liner_notes (might_have) not prefetched - do not load +is($queries, 1, 'liner_notes (might_have) not prefetched - do not load liner_notes on update'); $schema->storage->debug($sdebug); @@ -36,7 +36,7 @@ $schema->storage->debug(1); $cd2->update; -is($queries, 1, 'liner_notes (might_have) prefetched - do not load +is($queries, 1, 'liner_notes (might_have) prefetched - do not load liner_notes on update'); warning_like { @@ -50,7 +50,7 @@ warning_like { { local $ENV{DBIC_DONT_VALIDATE_RELS} = 1; - warning_is { + warning_is { DBICTest::Schema::Bookmark->might_have( slinky => 'DBICTest::Schema::Link', { "foreign.id" => "self.link" }, diff --git a/t/86sqlt.t b/t/86sqlt.t index 76e759d..5726870 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -115,7 +115,7 @@ my $schema = DBICTest->init_schema (no_deploy => 1); } -my $translator = SQL::Translator->new( +my $translator = SQL::Translator->new( parser_args => { 'DBIx::Schema' => $schema, }, @@ -159,15 +159,15 @@ my %fk_constraints = ( { 'display' => 'twokeys->cd', 'name' => 'twokeys_fk_cd', 'index_name' => 'twokeys_idx_cd', - 'selftable' => 'twokeys', 'foreigntable' => 'cd', - 'selfcols' => ['cd'], 'foreigncols' => ['cdid'], + 'selftable' => 'twokeys', 'foreigntable' => 'cd', + 'selfcols' => ['cd'], 'foreigncols' => ['cdid'], 'noindex' => 1, on_delete => '', on_update => '', deferrable => 0, }, { 'display' => 'twokeys->artist', 'name' => 'twokeys_fk_artist', 'index_name' => 'twokeys_idx_artist', - 'selftable' => 'twokeys', 'foreigntable' => 'artist', + 'selftable' => 'twokeys', 'foreigntable' => 'artist', 'selfcols' => ['artist'], 'foreigncols' => ['artistid'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, @@ -178,16 +178,16 @@ my %fk_constraints = ( { 'display' => 'fourkeys_to_twokeys->twokeys', 'name' => 'fourkeys_to_twokeys_fk_t_artist_t_cd', 'index_name' => 'fourkeys_to_twokeys_idx_t_artist_t_cd', - 'selftable' => 'fourkeys_to_twokeys', 'foreigntable' => 'twokeys', - 'selfcols' => ['t_artist', 't_cd'], 'foreigncols' => ['artist', 'cd'], + 'selftable' => 'fourkeys_to_twokeys', 'foreigntable' => 'twokeys', + 'selfcols' => ['t_artist', 't_cd'], 'foreigncols' => ['artist', 'cd'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, { 'display' => 'fourkeys_to_twokeys->fourkeys', 'index_name' => 'fourkeys_to_twokeys_idx_f_foo_f_bar_f_hello_f_goodbye', 'name' => 'fourkeys_to_twokeys_fk_f_foo_f_bar_f_hello_f_goodbye', - 'selftable' => 'fourkeys_to_twokeys', 'foreigntable' => 'fourkeys', + 'selftable' => 'fourkeys_to_twokeys', 'foreigntable' => 'fourkeys', 'selfcols' => [qw(f_foo f_bar f_hello f_goodbye)], - 'foreigncols' => [qw(foo bar hello goodbye)], + 'foreigncols' => [qw(foo bar hello goodbye)], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, ], @@ -197,14 +197,14 @@ my %fk_constraints = ( { 'display' => 'cd_to_producer->cd', 'name' => 'cd_to_producer_fk_cd', 'index_name' => 'cd_to_producer_idx_cd', - 'selftable' => 'cd_to_producer', 'foreigntable' => 'cd', + 'selftable' => 'cd_to_producer', 'foreigntable' => 'cd', 'selfcols' => ['cd'], 'foreigncols' => ['cdid'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, { 'display' => 'cd_to_producer->producer', 'name' => 'cd_to_producer_fk_producer', 'index_name' => 'cd_to_producer_idx_producer', - 'selftable' => 'cd_to_producer', 'foreigntable' => 'producer', + 'selftable' => 'cd_to_producer', 'foreigntable' => 'producer', 'selfcols' => ['producer'], 'foreigncols' => ['producerid'], on_delete => '', on_update => '', deferrable => 1, }, @@ -215,14 +215,14 @@ my %fk_constraints = ( { 'display' => 'self_ref_alias->self_ref for self_ref', 'name' => 'self_ref_alias_fk_self_ref', 'index_name' => 'self_ref_alias_idx_self_ref', - 'selftable' => 'self_ref_alias', 'foreigntable' => 'self_ref', + 'selftable' => 'self_ref_alias', 'foreigntable' => 'self_ref', 'selfcols' => ['self_ref'], 'foreigncols' => ['id'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, { 'display' => 'self_ref_alias->self_ref for alias', 'name' => 'self_ref_alias_fk_alias', 'index_name' => 'self_ref_alias_idx_alias', - 'selftable' => 'self_ref_alias', 'foreigntable' => 'self_ref', + 'selftable' => 'self_ref_alias', 'foreigntable' => 'self_ref', 'selfcols' => ['alias'], 'foreigncols' => ['id'], on_delete => '', on_update => '', deferrable => 1, }, @@ -233,7 +233,7 @@ my %fk_constraints = ( { 'display' => 'cd->artist', 'name' => 'cd_fk_artist', 'index_name' => 'cd_idx_artist', - 'selftable' => 'cd', 'foreigntable' => 'artist', + 'selftable' => 'cd', 'foreigntable' => 'artist', 'selfcols' => ['artist'], 'foreigncols' => ['artistid'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, @@ -244,14 +244,14 @@ my %fk_constraints = ( { 'display' => 'artist_undirected_map->artist for id1', 'name' => 'artist_undirected_map_fk_id1', 'index_name' => 'artist_undirected_map_idx_id1', - 'selftable' => 'artist_undirected_map', 'foreigntable' => 'artist', + 'selftable' => 'artist_undirected_map', 'foreigntable' => 'artist', 'selfcols' => ['id1'], 'foreigncols' => ['artistid'], on_delete => 'RESTRICT', on_update => 'CASCADE', deferrable => 1, }, { 'display' => 'artist_undirected_map->artist for id2', 'name' => 'artist_undirected_map_fk_id2', 'index_name' => 'artist_undirected_map_idx_id2', - 'selftable' => 'artist_undirected_map', 'foreigntable' => 'artist', + 'selftable' => 'artist_undirected_map', 'foreigntable' => 'artist', 'selfcols' => ['id2'], 'foreigncols' => ['artistid'], on_delete => '', on_update => '', deferrable => 1, }, @@ -262,7 +262,7 @@ my %fk_constraints = ( { 'display' => 'track->cd', 'name' => 'track_fk_cd', 'index_name' => 'track_idx_cd', - 'selftable' => 'track', 'foreigntable' => 'cd', + 'selftable' => 'track', 'foreigntable' => 'cd', 'selfcols' => ['cd'], 'foreigncols' => ['cdid'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, @@ -273,7 +273,7 @@ my %fk_constraints = ( { 'display' => 'treelike->treelike for parent', 'name' => 'treelike_fk_parent', 'index_name' => 'treelike_idx_parent', - 'selftable' => 'treelike', 'foreigntable' => 'treelike', + 'selftable' => 'treelike', 'foreigntable' => 'treelike', 'selfcols' => ['parent'], 'foreigncols' => ['id'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, @@ -284,7 +284,7 @@ my %fk_constraints = ( { 'display' => 'twokeytreelike->twokeytreelike for parent1,parent2', 'name' => 'twokeytreelike_fk_parent1_parent2', 'index_name' => 'twokeytreelike_idx_parent1_parent2', - 'selftable' => 'twokeytreelike', 'foreigntable' => 'twokeytreelike', + 'selftable' => 'twokeytreelike', 'foreigntable' => 'twokeytreelike', 'selfcols' => ['parent1', 'parent2'], 'foreigncols' => ['id1','id2'], on_delete => '', on_update => '', deferrable => 1, }, @@ -295,7 +295,7 @@ my %fk_constraints = ( { 'display' => 'tags->cd', 'name' => 'tags_fk_cd', 'index_name' => 'tags_idx_cd', - 'selftable' => 'tags', 'foreigntable' => 'cd', + 'selftable' => 'tags', 'foreigntable' => 'cd', 'selfcols' => ['cd'], 'foreigncols' => ['cdid'], on_delete => 'CASCADE', on_update => 'CASCADE', deferrable => 1, }, @@ -306,7 +306,7 @@ my %fk_constraints = ( { 'display' => 'bookmark->link', 'name' => 'bookmark_fk_link', 'index_name' => 'bookmark_idx_link', - 'selftable' => 'bookmark', 'foreigntable' => 'link', + 'selftable' => 'bookmark', 'foreigntable' => 'link', 'selfcols' => ['link'], 'foreigncols' => ['id'], on_delete => 'SET NULL', on_update => 'CASCADE', deferrable => 1, }, @@ -316,8 +316,8 @@ my %fk_constraints = ( { 'display' => 'forceforeign->artist', 'name' => 'forceforeign_fk_artist', 'index_name' => 'forceforeign_idx_artist', - 'selftable' => 'forceforeign', 'foreigntable' => 'artist', - 'selfcols' => ['artist'], 'foreigncols' => ['artistid'], + 'selftable' => 'forceforeign', 'foreigntable' => 'artist', + 'selfcols' => ['artist'], 'foreigncols' => ['artistid'], 'noindex' => 1, on_delete => '', on_update => '', deferrable => 1, }, @@ -387,7 +387,7 @@ SKIP: { skip ('Artist sqlt_deploy_hook is only called with an SQLite backend', 1) if $schema->storage->sqlt_type ne 'SQLite'; - ok( ( grep + ok( ( grep { $_->name eq 'artist_name_hookidx' } $tschema->get_table('artist')->get_indices ), 'sqlt_deploy_hook fired within a resultsource'); @@ -488,7 +488,7 @@ sub get_index { CAND_INDEX: for my $cand_index ( $table->get_indices ) { - + next CAND_INDEX if $index->{name} && $cand_index->name ne $index->{name} || $index->{type} && $cand_index->type ne $index->{type}; diff --git a/t/87ordered.t b/t/87ordered.t index 0980509..324be84 100644 --- a/t/87ordered.t +++ b/t/87ordered.t @@ -1,6 +1,6 @@ # vim: filetype=perl use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); @@ -181,15 +181,15 @@ $employee->group_id_2(1); $employee->update; ok( check_rs($employees->search_rs({group_id_2=>4, group_id_3=>1})) - && check_rs($employees->search_rs({group_id_2=>1, group_id_3=>1})), - "overloaded multicol update 1" + && check_rs($employees->search_rs({group_id_2=>1, group_id_3=>1})), + "overloaded multicol update 1" ); $employee = $employees->search({group_id_2=>4, group_id_3=>1})->first; $employee->update({group_id_2=>2}); ok( check_rs($employees->search_rs({group_id_2=>4, group_id_3=>1})) - && check_rs($employees->search_rs({group_id_2=>2, group_id_3=>1})), - "overloaded multicol update 2" + && check_rs($employees->search_rs({group_id_2=>2, group_id_3=>1})), + "overloaded multicol update 2" ); $employee = $employees->search({group_id_2=>3, group_id_3=>1})->first; @@ -198,21 +198,21 @@ $employee->group_id_3(3); $employee->update(); ok( check_rs($employees->search_rs({group_id_2=>3, group_id_3=>1})) && check_rs($employees->search_rs({group_id_2=>1, group_id_3=>3})), - "overloaded multicol update 3" + "overloaded multicol update 3" ); $employee = $employees->search({group_id_2=>3, group_id_3=>1})->first; $employee->update({group_id_2=>2, group_id_3=>3}); ok( check_rs($employees->search_rs({group_id_2=>3, group_id_3=>1})) - && check_rs($employees->search_rs({group_id_2=>2, group_id_3=>3})), - "overloaded multicol update 4" + && check_rs($employees->search_rs({group_id_2=>2, group_id_3=>3})), + "overloaded multicol update 4" ); $employee = $employees->search({group_id_2=>3, group_id_3=>2})->first; $employee->update({group_id_2=>2, group_id_3=>4, position=>2}); ok( check_rs($employees->search_rs({group_id_2=>3, group_id_3=>2})) - && check_rs($employees->search_rs({group_id_2=>2, group_id_3=>4})), - "overloaded multicol update 5" + && check_rs($employees->search_rs({group_id_2=>2, group_id_3=>4})), + "overloaded multicol update 5" ); sub hammer_rs { diff --git a/t/90ensure_class_loaded.t b/t/90ensure_class_loaded.t index 1746d4c..f14911d 100644 --- a/t/90ensure_class_loaded.t +++ b/t/90ensure_class_loaded.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/91merge_joinpref_attr.t b/t/91merge_joinpref_attr.t index 17b40ca..0e9f601 100644 --- a/t/91merge_joinpref_attr.t +++ b/t/91merge_joinpref_attr.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/93single_accessor_object.t b/t/93single_accessor_object.t index e250183..a285b1a 100644 --- a/t/93single_accessor_object.t +++ b/t/93single_accessor_object.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; diff --git a/t/94pk_mutation.t b/t/94pk_mutation.t index 133a27b..3cdc47c 100644 --- a/t/94pk_mutation.t +++ b/t/94pk_mutation.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/t/94versioning.t b/t/94versioning.t index 09ce788..865ac26 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -259,11 +259,11 @@ system( qq($^X -pi.bak -e "s/ALTER/-- this is a comment\nALTER/" $fn->{trans_v23 DBICVersion::Schema->connect({ dsn => $dsn, - user => $user, + user => $user, pass => $pass, ignore_version => 1 }); - + ok($get_db_version_run == 0, "attributes pulled from hashref connect_info"); $get_db_version_run = 0; diff --git a/t/97result_class.t b/t/97result_class.t index 0b0db50..ab0863d 100644 --- a/t/97result_class.t +++ b/t/97result_class.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; @@ -12,7 +12,7 @@ plan tests => 12; { my $cd_rc = $schema->resultset("CD")->result_class; - + throws_ok { $schema->resultset("Artist") ->search_rs({}, {result_class => "IWillExplode"}) @@ -43,21 +43,21 @@ plan tests => 12; my $cd_rs3 = $schema->resultset("Artist")->search_rs({},{})->related_resultset('cds'); is($cd_rs->result_class, $cd_rc, 'Correct cd3 result_class'); - + isa_ok(eval{ $cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class'); } { my $cd_rc = $schema->resultset("CD")->result_class; - + my $artist_rs = $schema->resultset("Artist") ->search_rs({}, {result_class => "IWillExplode"})->search({artistid => 1}); is($artist_rs->result_class, 'IWillExplode', 'Correct artist result_class'); - + my $cd_rs = $artist_rs->related_resultset('cds'); is($cd_rs->result_class, $cd_rc, 'Correct cd result_class'); - - isa_ok(eval{ $cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class'); + + isa_ok(eval{ $cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class'); isa_ok(eval{ $cd_rs->search({ cdid => 1 })->first }, $cd_rc, 'Inflated into correct cd result_class'); } diff --git a/t/99dbic_sqlt_parser.t b/t/99dbic_sqlt_parser.t index 87e4d68..a9fba8f 100644 --- a/t/99dbic_sqlt_parser.t +++ b/t/99dbic_sqlt_parser.t @@ -207,7 +207,7 @@ sub create_schema { my $additional_sqltargs = $args->{args} || {}; my $sqltargs = { - add_drop_table => 1, + add_drop_table => 1, ignore_constraint_names => 1, ignore_index_names => 1, %{$additional_sqltargs} diff --git a/t/admin/03data.t b/t/admin/03data.t index 8294c68..05ae009 100644 --- a/t/admin/03data.t +++ b/t/admin/03data.t @@ -45,7 +45,7 @@ use_ok 'DBIx::Class::Admin'; $admin->insert('Employee', {name =>'Aran'}); - my $expected_data = [ + my $expected_data = [ [$employee->result_source->columns() ], [1,1,undef,undef,undef,'Trout',undef], [2,2,undef,undef,undef,'Aran',undef] diff --git a/t/cdbi/02-Film.t b/t/cdbi/02-Film.t index 2eb4f05..5ef43bb 100644 --- a/t/cdbi/02-Film.t +++ b/t/cdbi/02-Film.t @@ -35,7 +35,7 @@ is(Film->__driver, "SQLite", "Driver set correctly"); eval { my $id = Film->title }; #like $@, qr/class method/, "Can't get title with no object"; ok $@, "Can't get title with no object"; -} +} eval { my $duh = Film->insert; }; like $@, qr/create needs a hashref/, "needs a hashref"; @@ -229,7 +229,7 @@ ok( # Test that a disconnect doesnt harm anything. { - # SQLite is loud on disconnect/reconnect. + # SQLite is loud on disconnect/reconnect. # This is solved in DBIC but not in ContextualFetch local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ @@ -400,7 +400,7 @@ SKIP: { my $btaste4 = Film->retrieve('Bad Taste'); isnt refaddr $btaste2, refaddr $btaste4, "Clearing cache and retrieving again gives new object"; - + $btaste=Film->insert({ Title => 'Bad Taste 2', Director => 'Peter Jackson', @@ -410,5 +410,5 @@ SKIP: { $btaste2 = Film->retrieve('Bad Taste 2'); is refaddr $btaste, refaddr $btaste2, "Creating and retrieving gives ref to same object"; - + } diff --git a/t/cdbi/04-lazy.t b/t/cdbi/04-lazy.t index 6c9a8d3..1ca4165 100644 --- a/t/cdbi/04-lazy.t +++ b/t/cdbi/04-lazy.t @@ -9,7 +9,7 @@ use Test::Warn; BEGIN { eval "use DBIx::Class::CDBICompat;"; - plan $@ + plan $@ ? (skip_all => 'Class::Trigger and DBIx::ContextualFetch required') : (tests => 36) ; @@ -110,7 +110,7 @@ warning_like { }, undef, 23, $l->this); is $l->oop, 23; - + $l->delete; } @@ -123,7 +123,7 @@ SKIP: { inflate => sub { Date::Simple->new($_[0] . '-01-01') }, deflate => 'format' ); - + my $l = Lazy->create({ this => 89, that => 2, @@ -135,13 +135,13 @@ SKIP: { SET orp = ? WHERE this = ? }, undef, 1987, $l->this); - + is $l->orp, '1987-01-01'; $l->orp(2007); is $l->orp, '2007-01-01'; # make sure it's inflated $l->update; - + ok $l->db_Main->do(qq{ UPDATE @{[ $l->table ]} SET orp = ? @@ -149,7 +149,7 @@ SKIP: { }, undef, 1942, $l->this); is $l->orp, '1942-01-01'; - + $l->delete; } @@ -163,16 +163,16 @@ SKIP: { oop => 3, opop => 4, }); - + # Delete the object without it knowing. Lazy->db_Main->do(qq[ DELETE FROM @{[ Lazy->table ]} WHERE this = 99 ]); - + $l->eep; - + # The problem was when an object had an inflated object # loaded. _flesh() would set _column_data to undef and # get_column() would think nothing was there. diff --git a/t/cdbi/06-hasa.t b/t/cdbi/06-hasa.t index 8cc8301..760a745 100644 --- a/t/cdbi/06-hasa.t +++ b/t/cdbi/06-hasa.t @@ -159,7 +159,7 @@ my $bar = Bar->create({ id => 2, fav => 6 }); isa_ok($bar->fav, "Foo"); isa_ok($foo->fav, "Film"); -{ +{ my $foo; Foo->add_trigger(after_create => sub { $foo = shift->fav }); my $gwh = Foo->create({ id => 93, fav => 'Good Will Hunting' }); diff --git a/t/cdbi/11-triggers.t b/t/cdbi/11-triggers.t index 37c179c..9c3bc07 100644 --- a/t/cdbi/11-triggers.t +++ b/t/cdbi/11-triggers.t @@ -57,7 +57,7 @@ is + ( ok $ver->delete, "Delete"; { - Film->add_trigger(before_create => sub { + Film->add_trigger(before_create => sub { my $self = shift; ok !$self->_attribute_exists('title'), "PK doesn't auto-vivify"; }); diff --git a/t/cdbi/14-might_have.t b/t/cdbi/14-might_have.t index 156a089..a02f987 100644 --- a/t/cdbi/14-might_have.t +++ b/t/cdbi/14-might_have.t @@ -62,7 +62,7 @@ Film->create_test_film; $blurb = Blurb->retrieve('Bad Taste'); is $blurb, undef, "Blurb has gone"; } - + } { diff --git a/t/cdbi/19-set_sql.t b/t/cdbi/19-set_sql.t index 7118e4a..73d9777 100644 --- a/t/cdbi/19-set_sql.t +++ b/t/cdbi/19-set_sql.t @@ -17,7 +17,7 @@ use Actor; my @cols = Film->columns('Essential'); is_deeply \@cols, ['title'], "1 Column in essential"; is +Film->transform_sql('__ESSENTIAL__'), 'title', '__ESSENTIAL__ expansion'; - + # This provides a more interesting test Film->columns(Essential => qw(title rating)); is +Film->transform_sql('__ESSENTIAL__'), 'title, rating', @@ -35,7 +35,7 @@ Film->set_sql( SELECT __ESSENTIAL__ FROM __TABLE__ WHERE __TABLE__.rating = 'PG' - ORDER BY title DESC + ORDER BY title DESC } ); @@ -59,7 +59,7 @@ Film->set_sql( SELECT __ESSENTIAL__ FROM __TABLE__ WHERE rating = ? - ORDER BY title DESC + ORDER BY title DESC } ); @@ -78,7 +78,7 @@ Film->set_sql( WHERE __IDENTIFIER__ } ); - + my $film = Film->retrieve_all->first; my @found = Film->search_by_id($film->id); is @found, 1; @@ -91,11 +91,11 @@ Film->set_sql( Film->set_sql( namerate => qq{ SELECT __ESSENTIAL(f)__ - FROM __TABLE(=f)__, __TABLE(Actor=a)__ - WHERE __JOIN(a f)__ + FROM __TABLE(=f)__, __TABLE(Actor=a)__ + WHERE __JOIN(a f)__ AND a.name LIKE ? AND f.rating = ? - ORDER BY title + ORDER BY title } ); @@ -114,11 +114,11 @@ Film->set_sql( Film->set_sql( ratename => qq{ SELECT __ESSENTIAL(f)__ - FROM __TABLE(=f)__, __TABLE(Actor=a)__ - WHERE __JOIN(f a)__ + FROM __TABLE(=f)__, __TABLE(Actor=a)__ + WHERE __JOIN(f a)__ AND f.rating = ? AND a.name LIKE ? - ORDER BY title + ORDER BY title } ); diff --git a/t/cdbi/23-cascade.t b/t/cdbi/23-cascade.t index dbd55c6..f91be4a 100644 --- a/t/cdbi/23-cascade.t +++ b/t/cdbi/23-cascade.t @@ -55,7 +55,7 @@ for my $args ({ no_cascade_delete => 1 }, { cascade => "None" }) { #{ # Fail on cascade # local $TODO = 'cascade => "Fail" unimplemented'; -# +# # Director->has_many(nasties => Film => { cascade => 'Fail' }); # # my $dir = Director->insert({ name => "Nasty Noddy" }); diff --git a/t/cdbi/24-meta_info.t b/t/cdbi/24-meta_info.t index ba72f17..32cc5ca 100644 --- a/t/cdbi/24-meta_info.t +++ b/t/cdbi/24-meta_info.t @@ -15,8 +15,8 @@ package Temp::DBI; use base qw(DBIx::Class::CDBICompat); Temp::DBI->columns(All => qw(id date)); -my $strptime_inflate = sub { - Time::Piece->strptime(shift, "%Y-%m-%d") +my $strptime_inflate = sub { + Time::Piece->strptime(shift, "%Y-%m-%d") }; Temp::DBI->has_a( date => 'Time::Piece', diff --git a/t/cdbi/26-mutator.t b/t/cdbi/26-mutator.t index 82049c3..54140cb 100644 --- a/t/cdbi/26-mutator.t +++ b/t/cdbi/26-mutator.t @@ -27,7 +27,7 @@ my $bt; eval { my $data = $data; $data->{sheep} = 1; - ok $bt = Film->insert($data), "Modified accessor - with + ok $bt = Film->insert($data), "Modified accessor - with accessor"; isa_ok $bt, "Film"; }; diff --git a/t/cdbi/30-pager.t b/t/cdbi/30-pager.t index 42c534e..d26b4e8 100644 --- a/t/cdbi/30-pager.t +++ b/t/cdbi/30-pager.t @@ -39,7 +39,7 @@ $it->next; is( $it->next, undef, "next past end of page ok" ); # second page -( $pager, $it ) = Film->page( +( $pager, $it ) = Film->page( {}, { rows => 3, page => 2 } diff --git a/t/cdbi/abstract/search_where.t b/t/cdbi/abstract/search_where.t index 2fb28ff..0d98bcc 100644 --- a/t/cdbi/abstract/search_where.t +++ b/t/cdbi/abstract/search_where.t @@ -29,7 +29,7 @@ is $superman->next, undef; is_deeply [sort map $_->Title, @supers], [sort ("Super Fuzz", "Superman")], 'like'; } - + my @all = Film->search_where({}, { order_by => "Title ASC" }); is_deeply ["Batman", "Super Fuzz", "Superman"], diff --git a/t/cdbi/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t index 06fc149..5e2d83c 100644 --- a/t/cdbi/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -52,15 +52,15 @@ warning_is { } '', 'DBIC_CDBICOMPAT_HASH_WARN controls warnings'; -{ +{ $waves->rating("R"); $waves->update; - + no warnings 'redefine'; local *Film::rating = sub { return "wibble"; }; - + is $waves->{rating}, "R"; } @@ -73,7 +73,7 @@ warning_is { return "movie" if lc $col eq "film"; return $col; }; - + require Actor; Actor->has_a( film => "Film" ); @@ -81,7 +81,7 @@ warning_is { name => 'Emily Watson', film => $waves, }); - + ok !eval { $actor->film }; is $actor->{film}->id, $waves->id, 'hash access still works despite lack of accessor'; @@ -100,7 +100,7 @@ SKIP: { tdate => '1949-02-01', }); isa_ok $foo, 'MyFoo'; - + isa_ok $foo->{tdate}, 'Date::Simple'; is $foo->{tdate}->year, 1949; } diff --git a/t/cdbi/construct.t b/t/cdbi/construct.t index 1ee7f14..3e364b3 100644 --- a/t/cdbi/construct.t +++ b/t/cdbi/construct.t @@ -38,6 +38,6 @@ INIT { my $film = Foo->construct({ temp_thing => 23 }); - + ::is $film->temp_thing, 23, "construct sets temp columns"; } diff --git a/t/cdbi/copy.t b/t/cdbi/copy.t index a6e60ba..2550619 100644 --- a/t/cdbi/copy.t +++ b/t/cdbi/copy.t @@ -12,7 +12,7 @@ INIT { } { - package # hide from PAUSE + package # hide from PAUSE MyFilm; use base 'DBIC::Test::SQLite'; diff --git a/t/cdbi/object_cache.t b/t/cdbi/object_cache.t index 320242f..d9034c2 100644 --- a/t/cdbi/object_cache.t +++ b/t/cdbi/object_cache.t @@ -38,14 +38,14 @@ ok +Film->create({ { Film->nocache(1); - + my $film1 = Film->retrieve( "This Is Spinal Tap" ); my $film2 = Film->retrieve( "This Is Spinal Tap" ); $film1->Director("Marty DiBergi"); is $film2->Director, "Rob Reiner", 'caching turned off'; - + $film1->discard_changes; } diff --git a/t/cdbi/sweet/08pager.t b/t/cdbi/sweet/08pager.t index ad9de5a..9bf7d9b 100644 --- a/t/cdbi/sweet/08pager.t +++ b/t/cdbi/sweet/08pager.t @@ -26,7 +26,7 @@ my ( $pager, $it ) = DBICTest::CD->page( { order_by => 'title', rows => 3, page => 1 } ); - + cmp_ok( $pager->entries_on_this_page, '==', 3, "entries_on_this_page ok" ); cmp_ok( $pager->next_page, '==', 2, "next_page ok" ); @@ -57,7 +57,7 @@ is( $it->next, undef, "disable_sql_paging next past end of page ok" ); # based on a failing criteria submitted by waswas ( $pager, $it ) = DBICTest::CD->page( { title => [ - -and => + -and => { -like => '%bees' }, diff --git a/t/cdbi/testlib/Actor.pm b/t/cdbi/testlib/Actor.pm index 9bbda39..83a03b9 100644 --- a/t/cdbi/testlib/Actor.pm +++ b/t/cdbi/testlib/Actor.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE Actor; use strict; @@ -19,7 +19,7 @@ sub create_sql { return qq{ id INTEGER PRIMARY KEY, name CHAR(40), - film VARCHAR(255), + film VARCHAR(255), salary INT } } diff --git a/t/cdbi/testlib/ActorAlias.pm b/t/cdbi/testlib/ActorAlias.pm index 30004b1..862a410 100644 --- a/t/cdbi/testlib/ActorAlias.pm +++ b/t/cdbi/testlib/ActorAlias.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE ActorAlias; use strict; diff --git a/t/cdbi/testlib/CDBase.pm b/t/cdbi/testlib/CDBase.pm index 4367ef0..282b74d 100644 --- a/t/cdbi/testlib/CDBase.pm +++ b/t/cdbi/testlib/CDBase.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE CDBase; use strict; diff --git a/t/cdbi/testlib/DBIC/Test/SQLite.pm b/t/cdbi/testlib/DBIC/Test/SQLite.pm index 3b17953..3934ce6 100644 --- a/t/cdbi/testlib/DBIC/Test/SQLite.pm +++ b/t/cdbi/testlib/DBIC/Test/SQLite.pm @@ -20,7 +20,7 @@ DBIx::Class::Test::SQLite - Base class for running Class::DBI tests against DBIx salary INT } } - + =head1 DESCRIPTION This provides a simple base class for DBIx::Class::CDBICompat tests using diff --git a/t/cdbi/testlib/Director.pm b/t/cdbi/testlib/Director.pm index 549aebb..511c0e7 100644 --- a/t/cdbi/testlib/Director.pm +++ b/t/cdbi/testlib/Director.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE Director; use strict; diff --git a/t/cdbi/testlib/Film.pm b/t/cdbi/testlib/Film.pm index 3d6c457..9ea829d 100644 --- a/t/cdbi/testlib/Film.pm +++ b/t/cdbi/testlib/Film.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE Film; use base 'DBIC::Test::SQLite'; @@ -21,7 +21,7 @@ sub create_sql { } } -sub create_test_film { +sub create_test_film { return shift->create({ Title => 'Bad Taste', Director => 'Peter Jackson', diff --git a/t/cdbi/testlib/Lazy.pm b/t/cdbi/testlib/Lazy.pm index 594032c..d05e817 100644 --- a/t/cdbi/testlib/Lazy.pm +++ b/t/cdbi/testlib/Lazy.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE Lazy; use base 'DBIC::Test::SQLite'; diff --git a/t/cdbi/testlib/Log.pm b/t/cdbi/testlib/Log.pm index 1d1c209..914c60d 100644 --- a/t/cdbi/testlib/Log.pm +++ b/t/cdbi/testlib/Log.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE Log; use base 'MyBase'; diff --git a/t/cdbi/testlib/MyFilm.pm b/t/cdbi/testlib/MyFilm.pm index 9e1c007..9e9a656 100644 --- a/t/cdbi/testlib/MyFilm.pm +++ b/t/cdbi/testlib/MyFilm.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE MyFilm; use base 'MyBase'; diff --git a/t/cdbi/testlib/MyFoo.pm b/t/cdbi/testlib/MyFoo.pm index 08e4821..28c3433 100644 --- a/t/cdbi/testlib/MyFoo.pm +++ b/t/cdbi/testlib/MyFoo.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE MyFoo; use base 'MyBase'; diff --git a/t/cdbi/testlib/MyStar.pm b/t/cdbi/testlib/MyStar.pm index ec68fa9..dffae9e 100644 --- a/t/cdbi/testlib/MyStar.pm +++ b/t/cdbi/testlib/MyStar.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE MyStar; use base 'MyBase'; diff --git a/t/cdbi/testlib/MyStarLink.pm b/t/cdbi/testlib/MyStarLink.pm index 5efb279..1da8733 100644 --- a/t/cdbi/testlib/MyStarLink.pm +++ b/t/cdbi/testlib/MyStarLink.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE MyStarLink; use base 'MyBase'; diff --git a/t/cdbi/testlib/MyStarLinkMCPK.pm b/t/cdbi/testlib/MyStarLinkMCPK.pm index f22e5f3..0b7f55a 100644 --- a/t/cdbi/testlib/MyStarLinkMCPK.pm +++ b/t/cdbi/testlib/MyStarLinkMCPK.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE MyStarLinkMCPK; use base 'MyBase'; diff --git a/t/cdbi/testlib/Order.pm b/t/cdbi/testlib/Order.pm index 337329a..d5281a7 100644 --- a/t/cdbi/testlib/Order.pm +++ b/t/cdbi/testlib/Order.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE Order; use strict; diff --git a/t/count/distinct.t b/t/count/distinct.t index cd10793..1ef8ccf 100644 --- a/t/count/distinct.t +++ b/t/count/distinct.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; @@ -47,7 +47,7 @@ for my $get_count ( $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->get_column('tag')->as_query } }, { distinct => 1 }); is($get_count->($rs), 7, 'Count with IN subquery with outside distinct'); - $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->get_column('tag')->as_query } }, { distinct => 1, select => 'tag' }), + $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->get_column('tag')->as_query } }, { distinct => 1, select => 'tag' }), is($get_count->($rs), 2, 'Count with IN subquery with outside distinct on a single column'); $rs = $schema->resultset('Tag')->search({ tag => { -in => $in_rs->search({}, { group_by => 'tag' })->get_column('tag')->as_query } }); diff --git a/t/discard_changes_in_DESTROY.t b/t/discard_changes_in_DESTROY.t index cefcda4..736664d 100644 --- a/t/discard_changes_in_DESTROY.t +++ b/t/discard_changes_in_DESTROY.t @@ -15,7 +15,7 @@ my $schema = DBICTest->init_schema(); local *DBICTest::Artist::DESTROY; local *DBICTest::Artist::DESTROY = sub { $_[0]->discard_changes }; - my $artist = $schema->resultset("Artist")->create( { + my $artist = $schema->resultset("Artist")->create( { artistid => 10, name => "artist number 10", }); diff --git a/t/inflate/core.t b/t/inflate/core.t index 3b105ce..aadc4af 100644 --- a/t/inflate/core.t +++ b/t/inflate/core.t @@ -38,7 +38,7 @@ is( ref($cd->year), 'DateTime', 'year is still a DateTime, ok' ); is( $cd->year->year, 1998, 'updated year, bypassing inflation' ); -is( $cd->year->month, 1, 'month is still 1' ); +is( $cd->year->month, 1, 'month is still 1' ); # get_inflated_column test diff --git a/t/inflate/datetime_firebird.t b/t/inflate/datetime_firebird.t index 613dfe3..c68a762 100644 --- a/t/inflate/datetime_firebird.t +++ b/t/inflate/datetime_firebird.t @@ -52,7 +52,7 @@ foreach my $conn_idx (0..$#info) { $schema = DBICTest::Schema->connect($dsn, $user, $pass, { quote_char => '"', - name_sep => '.', + name_sep => '.', on_connect_call => [ 'datetime_setup' ], }); @@ -78,7 +78,7 @@ SQL my $row; ok( $row = $rs->create({ id => 1, - starts_at => $date_only, + starts_at => $date_only, created_on => $dt, })); ok( $row = $rs->search({ id => 1 }, { select => [qw/starts_at created_on/] }) @@ -96,7 +96,7 @@ done_testing; # clean up our mess sub cleanup { - my $dbh; + my $dbh; eval { $schema->storage->disconnect; # to avoid object FOO is in use errors $dbh = $schema->storage->dbh; diff --git a/t/inflate/datetime_informix.t b/t/inflate/datetime_informix.t index 5746f25..1df923e 100644 --- a/t/inflate/datetime_informix.t +++ b/t/inflate/datetime_informix.t @@ -52,7 +52,7 @@ SQL my $row; ok( $row = $rs->create({ id => 1, - starts_at => $date_only, + starts_at => $date_only, created_on => $dt, })); ok( $row = $rs->search({ id => 1 }, { select => [qw/starts_at created_on/] }) @@ -70,7 +70,7 @@ done_testing; # clean up our mess sub cleanup { - my $dbh; + my $dbh; eval { $dbh = $schema->storage->dbh; }; diff --git a/t/inflate/datetime_sqlanywhere.t b/t/inflate/datetime_sqlanywhere.t index 6788f87..606394f 100644 --- a/t/inflate/datetime_sqlanywhere.t +++ b/t/inflate/datetime_sqlanywhere.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; @@ -50,7 +50,7 @@ foreach my $info (@info) { on_connect_call => 'datetime_setup', }); - my $sg = Scope::Guard->new(\&cleanup); + my $sg = Scope::Guard->new(\&cleanup); eval { $schema->storage->dbh->do('DROP TABLE event') }; $schema->storage->dbh->do(<<"SQL"); diff --git a/t/inflate/hri.t b/t/inflate/hri.t index 1a497d4..eaf9128 100644 --- a/t/inflate/hri.t +++ b/t/inflate/hri.t @@ -130,7 +130,7 @@ for my $index (0 .. $#hashrefinf) { } # sometimes for ultra-mega-speed you want to fetch columns in esoteric ways -# check the inflator over a non-fetching join +# check the inflator over a non-fetching join $rs_dbic = $schema->resultset ('Artist')->search ({ 'me.artistid' => 1}, { prefetch => { cds => 'tracks' }, order_by => [qw/cds.cdid tracks.trackid/], diff --git a/t/inflate/serialize.t b/t/inflate/serialize.t index 87fb7ce..30d63ec 100644 --- a/t/inflate/serialize.t +++ b/t/inflate/serialize.t @@ -59,14 +59,14 @@ my $inflated; #======= testing hashref serialization -my $object = $rs->create( { +my $object = $rs->create( { serialized => '', } ); ok($object->update( { serialized => $struct_hash } ), 'hashref deflation'); ok($inflated = $object->serialized, 'hashref inflation'); is_deeply($inflated, $struct_hash, 'inflated hash matches original'); -$object = $rs->create( { +$object = $rs->create( { serialized => '', } ); $object->set_inflated_column('serialized', $struct_hash); diff --git a/t/lib/DBIC/SqlMakerTest.pm b/t/lib/DBIC/SqlMakerTest.pm index 44ccb4b..8fd047c 100644 --- a/t/lib/DBIC/SqlMakerTest.pm +++ b/t/lib/DBIC/SqlMakerTest.pm @@ -64,10 +64,10 @@ DBIC::SqlMakerTest - Helper package for testing sql_maker component of DBIC use Test::More; use DBIC::SqlMakerTest; - + my ($sql, @bind) = $schema->storage->sql_maker->select(%args); is_same_sql_bind( - $sql, \@bind, + $sql, \@bind, $expected_sql, \@expected_bind, 'foo bar works' ); @@ -118,7 +118,7 @@ result, with C<$test_msg> as message. =head2 is_same_bind is_same_bind( - \@given_bind, + \@given_bind, \@expected_bind, $test_msg ); diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index b4a60aa..4b8b951 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest; use strict; @@ -17,12 +17,12 @@ DBICTest - Library to be used by DBIx::Class test scripts. use lib qw(t/lib); use DBICTest; use Test::More; - + my $schema = DBICTest->init_schema(); =head1 DESCRIPTION -This module provides the basic utilities to write tests against +This module provides the basic utilities to write tests against DBIx::Class. =head1 METHODS @@ -38,13 +38,13 @@ DBIx::Class. }, ); -This method removes the test SQLite database in t/var/DBIxClass.db +This method removes the test SQLite database in t/var/DBIxClass.db and then creates a new, empty database. -This method will call deploy_schema() by default, unless the +This method will call deploy_schema() by default, unless the no_deploy flag is set. -Also, by default, this method will call populate_schema() by +Also, by default, this method will call populate_schema() by default, unless the no_deploy or no_populate flags are set. =cut @@ -215,10 +215,10 @@ sub init_schema { DBICTest->deploy_schema( $schema ); -This method does one of two things to the schema. It can either call -the experimental $schema->deploy() if the DBICTEST_SQLT_DEPLOY environment -variable is set, otherwise the default is to read in the t/lib/sqlite.sql -file and execute the SQL within. Either way you end up with a fresh set +This method does one of two things to the schema. It can either call +the experimental $schema->deploy() if the DBICTEST_SQLT_DEPLOY environment +variable is set, otherwise the default is to read in the t/lib/sqlite.sql +file and execute the SQL within. Either way you end up with a fresh set of tables for testing. =cut @@ -228,7 +228,7 @@ sub deploy_schema { my $schema = shift; my $args = shift || {}; - if ($ENV{"DBICTEST_SQLT_DEPLOY"}) { + if ($ENV{"DBICTEST_SQLT_DEPLOY"}) { $schema->deploy($args); } else { my $filename = Path::Class::File->new(__FILE__)->dir @@ -247,7 +247,7 @@ sub deploy_schema { DBICTest->populate_schema( $schema ); -After you deploy your schema you can use this method to populate +After you deploy your schema you can use this method to populate the tables with test data. =cut @@ -346,7 +346,7 @@ sub populate_schema { [ 1, 2 ], [ 1, 3 ], ]); - + $schema->populate('TreeLike', [ [ qw/id parent name/ ], [ 1, undef, 'root' ], @@ -397,7 +397,7 @@ sub populate_schema { [ 1, "Tools" ], [ 2, "Body Parts" ], ]); - + $schema->populate('TypedObject', [ [ qw/objectid type value/ ], [ 1, "pointy", "Awl" ], diff --git a/t/lib/DBICTest/ErrorComponent.pm b/t/lib/DBICTest/ErrorComponent.pm index 67f54e8..28c1d0a 100644 --- a/t/lib/DBICTest/ErrorComponent.pm +++ b/t/lib/DBICTest/ErrorComponent.pm @@ -1,5 +1,5 @@ # belongs to t/run/90ensure_class_loaded.tl -package # hide from PAUSE +package # hide from PAUSE DBICTest::ErrorComponent; use warnings; use strict; diff --git a/t/lib/DBICTest/FakeComponent.pm b/t/lib/DBICTest/FakeComponent.pm index fbe21f0..5d7fa19 100644 --- a/t/lib/DBICTest/FakeComponent.pm +++ b/t/lib/DBICTest/FakeComponent.pm @@ -1,5 +1,5 @@ # belongs to t/run/90ensure_class_loaded.tl -package # hide from PAUSE +package # hide from PAUSE DBICTest::FakeComponent; use warnings; use strict; diff --git a/t/lib/DBICTest/ForeignComponent.pm b/t/lib/DBICTest/ForeignComponent.pm index 333dd26..e3d98a1 100644 --- a/t/lib/DBICTest/ForeignComponent.pm +++ b/t/lib/DBICTest/ForeignComponent.pm @@ -1,5 +1,5 @@ # belongs to t/05components.t -package # hide from PAUSE +package # hide from PAUSE DBICTest::ForeignComponent; use warnings; use strict; diff --git a/t/lib/DBICTest/OptionalComponent.pm b/t/lib/DBICTest/OptionalComponent.pm index 5f0d36a..e76f64c 100644 --- a/t/lib/DBICTest/OptionalComponent.pm +++ b/t/lib/DBICTest/OptionalComponent.pm @@ -1,5 +1,5 @@ # belongs to t/run/90ensure_class_loaded.tl -package # hide from PAUSE +package # hide from PAUSE DBICTest::OptionalComponent; use warnings; use strict; diff --git a/t/lib/DBICTest/ResultSetManager.pm b/t/lib/DBICTest/ResultSetManager.pm index 08b3159..1fafbf0 100644 --- a/t/lib/DBICTest/ResultSetManager.pm +++ b/t/lib/DBICTest/ResultSetManager.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::ResultSetManager; use base 'DBIx::Class::Schema'; diff --git a/t/lib/DBICTest/ResultSetManager/Foo.pm b/t/lib/DBICTest/ResultSetManager/Foo.pm index 30c1c95..fec8345 100644 --- a/t/lib/DBICTest/ResultSetManager/Foo.pm +++ b/t/lib/DBICTest/ResultSetManager/Foo.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::ResultSetManager::Foo; use base 'DBIx::Class::Core'; diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index e1556ae..2e9ff35 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::Artist; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/ArtistGUID.pm b/t/lib/DBICTest/Schema/ArtistGUID.pm index ce619b9..a06a465 100644 --- a/t/lib/DBICTest/Schema/ArtistGUID.pm +++ b/t/lib/DBICTest/Schema/ArtistGUID.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::ArtistGUID; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm b/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm index 4ade6a0..e79faaa 100644 --- a/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm +++ b/t/lib/DBICTest/Schema/ArtistUndirectedMap.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::ArtistUndirectedMap; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/BindType.pm b/t/lib/DBICTest/Schema/BindType.pm index 459aef7..e25ad92 100644 --- a/t/lib/DBICTest/Schema/BindType.pm +++ b/t/lib/DBICTest/Schema/BindType.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::BindType; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/BooksInLibrary.pm b/t/lib/DBICTest/Schema/BooksInLibrary.pm index 24d5657..325a460 100644 --- a/t/lib/DBICTest/Schema/BooksInLibrary.pm +++ b/t/lib/DBICTest/Schema/BooksInLibrary.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::BooksInLibrary; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/CD.pm b/t/lib/DBICTest/Schema/CD.pm index 9a147d8..0cbf55a 100644 --- a/t/lib/DBICTest/Schema/CD.pm +++ b/t/lib/DBICTest/Schema/CD.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::CD; use base qw/DBICTest::BaseResult/; @@ -23,7 +23,7 @@ __PACKAGE__->add_columns( data_type => 'varchar', size => 100, }, - 'genreid' => { + 'genreid' => { data_type => 'integer', is_nullable => 1, accessor => undef, @@ -37,17 +37,17 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key('cdid'); __PACKAGE__->add_unique_constraint([ qw/artist title/ ]); -__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, { - is_deferrable => 1, +__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, { + is_deferrable => 1, proxy => { artist_name => 'name' }, }); -__PACKAGE__->belongs_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', { - is_deferrable => 1, +__PACKAGE__->belongs_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', { + is_deferrable => 1, }); # in case this is a single-cd it promotes a track from another cd -__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track', - { join_type => 'left'} +__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track', + { join_type => 'left'} ); __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' ); diff --git a/t/lib/DBICTest/Schema/CD_to_Producer.pm b/t/lib/DBICTest/Schema/CD_to_Producer.pm index f0f14f0..278396e 100644 --- a/t/lib/DBICTest/Schema/CD_to_Producer.pm +++ b/t/lib/DBICTest/Schema/CD_to_Producer.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::CD_to_Producer; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/Collection.pm b/t/lib/DBICTest/Schema/Collection.pm index 96f6399..5943c91 100644 --- a/t/lib/DBICTest/Schema/Collection.pm +++ b/t/lib/DBICTest/Schema/Collection.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::Collection; use base qw/DBICTest::BaseResult/; @@ -24,7 +24,7 @@ __PACKAGE__->many_to_many( pointy_objects => collection_object => "object", { where => { "object.type" => "pointy" } } ); __PACKAGE__->many_to_many( round_objects => collection_object => "object", - { where => { "object.type" => "round" } } + { where => { "object.type" => "round" } } ); 1; diff --git a/t/lib/DBICTest/Schema/CollectionObject.pm b/t/lib/DBICTest/Schema/CollectionObject.pm index 446909c..a0c8a30 100644 --- a/t/lib/DBICTest/Schema/CollectionObject.pm +++ b/t/lib/DBICTest/Schema/CollectionObject.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::CollectionObject; use base qw/DBICTest::BaseResult/; diff --git a/t/lib/DBICTest/Schema/ComputedColumn.pm b/t/lib/DBICTest/Schema/ComputedColumn.pm index 6832b3e..d47129c 100644 --- a/t/lib/DBICTest/Schema/ComputedColumn.pm +++ b/t/lib/DBICTest/Schema/ComputedColumn.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::ComputedColumn; # for sybase and mssql computed column tests diff --git a/t/lib/DBICTest/Schema/CustomSql.pm b/t/lib/DBICTest/Schema/CustomSql.pm index bdad8b8..c87e89d 100644 --- a/t/lib/DBICTest/Schema/CustomSql.pm +++ b/t/lib/DBICTest/Schema/CustomSql.pm @@ -1,4 +1,4 @@ -package # hide from PAUSE +package # hide from PAUSE DBICTest::Schema::CustomSql; use base qw/DBICTest::Schema::Artist/; @@ -6,7 +6,7 @@ use base qw/DBICTest::Schema::Artist/; __PACKAGE__->table('dummy'); __PACKAGE__->result_source_instance->name(\<init_schema(); # even if the preceeding relationship already exists. # # To get this to work a minor rewrite of find() is necessary, and -# more importantly some sort of recursive_insert() call needs to +# more importantly some sort of recursive_insert() call needs to # be available. The way things will work then is: # *) while traversing the hierarchy code calls find_or_create() # *) this in turn calls find(%\nested_dataset) diff --git a/t/multi_create/in_memory.t b/t/multi_create/in_memory.t index 83341b1..f1bb0d7 100644 --- a/t/multi_create/in_memory.t +++ b/t/multi_create/in_memory.t @@ -8,7 +8,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); -# Test various new() invocations - this is all about backcompat, making +# Test various new() invocations - this is all about backcompat, making # sure that insert() still works as expected by legacy code. # # What we essentially do is multi-instantiate objects, making sure nothing diff --git a/t/multi_create/standard.t b/t/multi_create/standard.t index 7aca7a4..263eec2 100644 --- a/t/multi_create/standard.t +++ b/t/multi_create/standard.t @@ -12,8 +12,8 @@ my $schema = DBICTest->init_schema(); lives_ok ( sub { my $cd = $schema->resultset('CD')->create({ - artist => { - name => 'Fred Bloggs' + artist => { + name => 'Fred Bloggs' }, title => 'Some CD', year => 1996 @@ -316,10 +316,10 @@ lives_ok ( sub { }, 'Test might_have again but with just a PK and FK (neither specified) in the mid-table'); lives_ok ( sub { - my $newartist2 = $schema->resultset('Artist')->find_or_create({ + my $newartist2 = $schema->resultset('Artist')->find_or_create({ name => 'Fred 3', cds => [ - { + { title => 'Noah Act', year => 2007, }, @@ -330,9 +330,9 @@ lives_ok ( sub { lives_ok ( sub { my $artist = $schema->resultset('Artist')->first; - + my $cd_result = $artist->create_related('cds', { - + title => 'TestOneCD1', year => 2007, tracks => [ @@ -341,14 +341,14 @@ lives_ok ( sub { ], }); - + isa_ok( $cd_result, 'DBICTest::CD', "Got Good CD Class"); ok( $cd_result->title eq "TestOneCD1", "Got Expected Title"); - + my $tracks = $cd_result->tracks; - + isa_ok( $tracks, 'DBIx::Class::ResultSet', 'Got Expected Tracks ResultSet'); - + foreach my $track ($tracks->all) { isa_ok( $track, 'DBICTest::Track', 'Got Expected Track Class'); @@ -357,9 +357,9 @@ lives_ok ( sub { lives_ok ( sub { my $artist = $schema->resultset('Artist')->first; - + my $cd_result = $artist->create_related('cds', { - + title => 'TestOneCD2', year => 2007, tracks => [ @@ -370,15 +370,15 @@ lives_ok ( sub { liner_notes => { notes => 'I can haz liner notes?' }, }); - + isa_ok( $cd_result, 'DBICTest::CD', "Got Good CD Class"); ok( $cd_result->title eq "TestOneCD2", "Got Expected Title"); ok( $cd_result->notes eq 'I can haz liner notes?', 'Liner notes'); - + my $tracks = $cd_result->tracks; - + isa_ok( $tracks, 'DBIx::Class::ResultSet', "Got Expected Tracks ResultSet"); - + foreach my $track ($tracks->all) { isa_ok( $track, 'DBICTest::Track', 'Got Expected Track Class'); @@ -408,17 +408,17 @@ lives_ok ( sub { $a = $schema->resultset('Artist')->find({name => 'Kurt Cobain'}); is($a->name, 'Kurt Cobain', 'Artist insertion ok'); - is($a->cds && $a->cds->first && $a->cds->first->title, + is($a->cds && $a->cds->first && $a->cds->first->title, 'In Utero', 'CD insertion ok'); }, 'populate'); ## Create foreign key col obj including PK ## See test 20 in 66relationships.t lives_ok ( sub { - my $new_cd_hashref = { - cdid => 27, - title => 'Boogie Woogie', - year => '2007', + my $new_cd_hashref = { + cdid => 27, + title => 'Boogie Woogie', + year => '2007', artist => { artistid => 17, name => 'king luke' } }; @@ -431,10 +431,10 @@ lives_ok ( sub { }, 'Create foreign key col obj including PK'); lives_ok ( sub { - $schema->resultset("CD")->create({ - cdid => 28, - title => 'Boogie Wiggle', - year => '2007', + $schema->resultset("CD")->create({ + cdid => 28, + title => 'Boogie Wiggle', + year => '2007', artist => { artistid => 18, name => 'larry' } }); }, 'new cd created without clash on related artist'); diff --git a/t/multi_create/torture.t b/t/multi_create/torture.t index 28a4e1d..1d3f23e 100644 --- a/t/multi_create/torture.t +++ b/t/multi_create/torture.t @@ -8,7 +8,7 @@ use DBICTest; plan tests => 23; -# an insane multicreate +# an insane multicreate # (should work, despite the fact that no one will probably use it this way) my $schema = DBICTest->init_schema(); @@ -38,7 +38,7 @@ eval { name => 'bob', producer_to_cd => [ { - cd => { + cd => { artist => { name => 'lars', cds => [ @@ -111,11 +111,11 @@ eval { }, }, { - cd => { + cd => { artist => { name => 'lars', # should already exist # even though the artist 'name' is not uniquely constrained - # find_or_create will arguably DWIM + # find_or_create will arguably DWIM }, title => 'Greatest hits 7', year => 2013, diff --git a/t/ordered/cascade_delete.t b/t/ordered/cascade_delete.t index 742df31..45379a6 100644 --- a/t/ordered/cascade_delete.t +++ b/t/ordered/cascade_delete.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; diff --git a/t/prefetch/attrs_untouched.t b/t/prefetch/attrs_untouched.t index ecb29dd..0526c4d 100644 --- a/t/prefetch/attrs_untouched.t +++ b/t/prefetch/attrs_untouched.t @@ -1,4 +1,4 @@ -use warnings; +use warnings; use Test::More; use Test::Exception; diff --git a/t/prefetch/diamond.t b/t/prefetch/diamond.t index 9dbea1a..f7a21e0 100644 --- a/t/prefetch/diamond.t +++ b/t/prefetch/diamond.t @@ -31,7 +31,7 @@ my $ars = $schema->resultset ('Artwork'); # The current artwork belongs to a cd by artist1 # but the artwork itself is painted by artist2 # -# What we try is all possible permutations of join/prefetch +# What we try is all possible permutations of join/prefetch # combinations in both directions, while always expecting to # arrive at the specific artist at the end of each path. diff --git a/t/prefetch/incomplete.t b/t/prefetch/incomplete.t index 8682ba7..c2a2b15 100644 --- a/t/prefetch/incomplete.t +++ b/t/prefetch/incomplete.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; diff --git a/t/prefetch/multiple_hasmany.t b/t/prefetch/multiple_hasmany.t index 311ac3f..3853c68 100644 --- a/t/prefetch/multiple_hasmany.t +++ b/t/prefetch/multiple_hasmany.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use Test::Exception; diff --git a/t/prefetch/standard.t b/t/prefetch/standard.t index 4c1c004..c961c37 100644 --- a/t/prefetch/standard.t +++ b/t/prefetch/standard.t @@ -40,7 +40,7 @@ $schema->storage->debugobj->callback(undef); # test for partial prefetch via columns attr my $cd = $schema->resultset('CD')->find(1, { - columns => [qw/title artist artist.name/], + columns => [qw/title artist artist.name/], join => { 'artist' => {} } } ); @@ -216,7 +216,7 @@ is(eval { $tree_like->children->first->children->first->name }, 'quux', 'Tree search_related with prefetch ok'); $tree_like = eval { $schema->resultset('TreeLike')->search( - { 'children.id' => 3, 'children_2.id' => 6 }, + { 'children.id' => 3, 'children_2.id' => 6 }, { join => [qw/children children children/] } )->search_related('children', { 'children_4.id' => 7 }, { prefetch => 'children' } )->first->children->first; }; diff --git a/t/relationship/core.t b/t/relationship/core.t index 44a61a3..4f9cff0 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -91,7 +91,7 @@ ok( !defined($track->cd), 'set_from_related with undef ok'); $track = $schema->resultset("Track")->new( {} ); $track->cd; -$track->set_from_related( cd => $cd ); +$track->set_from_related( cd => $cd ); ok ($track->cd, 'set_from_related ok after using the accessor' ); # update_from_related, the same as set_from_related, but it calls update afterwards @@ -144,8 +144,8 @@ my $newartist = $cd->find_or_new_related( 'artist', { is($newartist->name, 'Random Boy Band Two', 'find_or_new_related new artist record with id'); is($newartist->id, 200, 'find_or_new_related new artist id set'); -lives_ok( - sub { +lives_ok( + sub { my $new_bookmark = $schema->resultset("Bookmark")->new_result( {} ); my $new_related_link = $new_bookmark->new_related( 'link', {} ); }, @@ -208,12 +208,12 @@ is( $prod_rs->first->name, 'Testy McProducer', $cd->add_to_producers({ name => 'Jack Black' }); is( $prod_rs->count(), 2, 'many_to_many add_to_$rel($hash) count ok' ); $cd->set_producers($schema->resultset('Producer')->all); -is( $cd->producers->count(), $prod_before_count+2, +is( $cd->producers->count(), $prod_before_count+2, 'many_to_many set_$rel(@objs) count ok' ); $cd->set_producers($schema->resultset('Producer')->find(1)); is( $cd->producers->count(), 1, 'many_to_many set_$rel($obj) count ok' ); $cd->set_producers([$schema->resultset('Producer')->all]); -is( $cd->producers->count(), $prod_before_count+2, +is( $cd->producers->count(), $prod_before_count+2, 'many_to_many set_$rel(\@objs) count ok' ); $cd->set_producers([$schema->resultset('Producer')->find(1)]); is( $cd->producers->count(), 1, 'many_to_many set_$rel([$obj]) count ok' ); @@ -313,7 +313,7 @@ my $rs_overridden = $schema->source('ForceForeign'); my $relinfo_with_attr = $rs_overridden->relationship_info ('cd_3'); cmp_ok($relinfo_with_attr->{attrs}{is_foreign_key_constraint}, '==', 0, "is_foreign_key_constraint defined for belongs_to relationships with attr."); -# check that relationships below left join relationships are forced to left joins +# check that relationships below left join relationships are forced to left joins # when traversing multiple belongs_to my $cds = $schema->resultset("CD")->search({ 'me.cdid' => 5 }, { join => { single_track => 'cd' } }); is($cds->count, 1, "subjoins under left joins force_left (string)"); diff --git a/t/relationship/update_or_create_multi.t b/t/relationship/update_or_create_multi.t index 6bb0e86..25dfe79 100644 --- a/t/relationship/update_or_create_multi.t +++ b/t/relationship/update_or_create_multi.t @@ -91,7 +91,7 @@ my ($search_sql) = $sql[0] =~ /^(SELECT .+?)\:/; is_same_sql ( $search_sql, 'SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track - FROM cd me + FROM cd me WHERE ( me.artist = ? AND me.title = ? AND me.genreid = ? ) ', 'expected select issued', diff --git a/t/resultset/as_subselect_rs.t b/t/resultset/as_subselect_rs.t index 61acc59..8644079 100644 --- a/t/resultset/as_subselect_rs.t +++ b/t/resultset/as_subselect_rs.t @@ -27,7 +27,7 @@ my $book_rs = $schema->resultset ('BooksInLibrary')->search ({}, { join => 'owne is_same_sql_bind ( $book_rs->as_subselect_rs->as_query, - '(SELECT me.id, me.source, me.owner, me.title, me.price + '(SELECT me.id, me.source, me.owner, me.title, me.price FROM ( SELECT me.id, me.source, me.owner, me.title, me.price FROM books me diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index e3fccc9..62f4791 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -49,7 +49,7 @@ TODO: { $new_source->source_name('Complex'); $new_source->name(\<<''); - ( SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year + ( SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) @@ -71,7 +71,7 @@ TODO: { $rs->as_query, "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) me WHERE title LIKE ?)", [ - [ {} => '1999' ], + [ {} => '1999' ], [ {} => 'Spoon%' ] ], 'got correct SQL' @@ -100,7 +100,7 @@ TODO: { $rs->as_query, "(SELECT me.artistid, me.name, me.rank, me.charfield FROM (SELECT a.*, cd.cdid AS cdid, cd.title AS title, cd.year AS year FROM artist a JOIN cd ON cd.artist = a.artistid WHERE cd.year = ?) me WHERE title LIKE ?)", [ - [ {} => '1999' ], + [ {} => '1999' ], [ {} => 'Spoon%' ] ], 'got correct SQL (cookbook arbitrary SQL, in separate file)' diff --git a/t/resultset/is_ordered.t b/t/resultset/is_ordered.t index bab58d0..fa0868e 100644 --- a/t/resultset/is_ordered.t +++ b/t/resultset/is_ordered.t @@ -37,11 +37,11 @@ ok !$rs->is_ordered, 'vanilla resultset is not ordered'; # More complicated ordering { - my $ordered = $rs->search(undef, { + my $ordered = $rs->search(undef, { order_by => [ - { -asc => 'artistid' }, + { -asc => 'artistid' }, { -desc => 'name' }, - ] + ] }); ok $ordered->is_ordered, 'more complicated resultset ordering is_ordered'; } diff --git a/t/resultset/update_delete.t b/t/resultset/update_delete.t index 539ae64..4a9eab4 100644 --- a/t/resultset/update_delete.t +++ b/t/resultset/update_delete.t @@ -87,7 +87,7 @@ $sub_rs->search ( is_deeply ( [ $tkfks->search ({ autopilot => [qw/a b x y/]}, { order_by => 'autopilot' }) - ->get_column ('pilot_sequence')->all + ->get_column ('pilot_sequence')->all ], [qw/11 21 30 40/], 'Only two rows incremented', @@ -100,7 +100,7 @@ $tkfks->search ( is_deeply ( [ $tkfks->search ({ autopilot => [qw/a b x y/]}, { order_by => 'autopilot' }) - ->get_column ('pilot_sequence')->all + ->get_column ('pilot_sequence')->all ], [qw/12 22 30 40/], 'Only two rows incremented (where => scalarref works)', diff --git a/t/sqlmaker/limit_dialects/fetch_first.t b/t/sqlmaker/limit_dialects/fetch_first.t index f084782..f229f4e 100644 --- a/t/sqlmaker/limit_dialects/fetch_first.t +++ b/t/sqlmaker/limit_dialects/fetch_first.t @@ -183,7 +183,7 @@ my $rs_selectas_top = $schema->resultset ('BooksInLibrary')->search ({}, { '+select' => ['owner.name'], '+as' => ['owner_name'], join => 'owner', - rows => 1 + rows => 1 }); is_same_sql_bind( $rs_selectas_top->search({})->as_query, diff --git a/t/sqlmaker/limit_dialects/first_skip.t b/t/sqlmaker/limit_dialects/first_skip.t index c9e93bb..539855c 100644 --- a/t/sqlmaker/limit_dialects/first_skip.t +++ b/t/sqlmaker/limit_dialects/first_skip.t @@ -88,7 +88,7 @@ is_same_sql_bind( [owner].[name], ( SELECT COUNT(*) FROM ( SELECT FIRST ? [owner].[id] FROM [owners] [owner] - WHERE [count].[id] = [owner].[id] and [count].[name] = ? + WHERE [count].[id] = [owner].[id] and [count].[name] = ? ) [owner] ) FROM [books] [me] diff --git a/t/sqlmaker/limit_dialects/skip_first.t b/t/sqlmaker/limit_dialects/skip_first.t index 897ed2e..ba2d8cf 100644 --- a/t/sqlmaker/limit_dialects/skip_first.t +++ b/t/sqlmaker/limit_dialects/skip_first.t @@ -88,7 +88,7 @@ is_same_sql_bind( [owner].[name], ( SELECT COUNT(*) FROM ( SELECT FIRST ? [owner].[id] FROM [owners] [owner] - WHERE [count].[id] = [owner].[id] and [count].[name] = ? + WHERE [count].[id] = [owner].[id] and [count].[name] = ? ) [owner] ) FROM [books] [me] diff --git a/t/sqlmaker/oracle.t b/t/sqlmaker/oracle.t index 14e74e2..350ad35 100644 --- a/t/sqlmaker/oracle.t +++ b/t/sqlmaker/oracle.t @@ -15,7 +15,7 @@ use DBIC::SqlMakerTest; use DBIx::Class::SQLMaker::Oracle; # -# Offline test for connect_by +# Offline test for connect_by # ( without active database connection) # my @handle_tests = ( @@ -43,7 +43,7 @@ my @handle_tests = ( bind => ['King'], msg => 'oracle.com example #1', }, - # CONNECT BY PRIOR employee_id = manager_id and + # CONNECT BY PRIOR employee_id = manager_id and # PRIOR account_mgr_id = customer_id ... { connect_by => { diff --git a/t/sqlmaker/order_by_bindtransport.t b/t/sqlmaker/order_by_bindtransport.t index 095f72d..22c82d5 100644 --- a/t/sqlmaker/order_by_bindtransport.t +++ b/t/sqlmaker/order_by_bindtransport.t @@ -30,9 +30,9 @@ sub test_order { } )->as_query, "( - SELECT me.foo, me.bar, me.hello, me.goodbye, me.sensors, me.read_count - FROM fourkeys me - WHERE ( foo = ? ) + SELECT me.foo, me.bar, me.hello, me.goodbye, me.sensors, me.read_count + FROM fourkeys me + WHERE ( foo = ? ) HAVING read_count > ? OR read_count < ? ORDER BY $args->{order_req} )", diff --git a/t/storage/txn.t b/t/storage/txn.t index 4d46e5b..09260f0 100644 --- a/t/storage/txn.t +++ b/t/storage/txn.t @@ -112,7 +112,7 @@ for my $want (0,1) { die "$$ starts in txn!" if $s->storage->transaction_depth != 0; $s->txn_do ( sub { die "$$ not in txn!" if $s->storage->transaction_depth == 0; - $s->storage->dbh->do('SELECT 1') } + $s->storage->dbh->do('SELECT 1') } ); die "$$ did not finish txn!" if $s->storage->transaction_depth != 0; }, diff --git a/t/update/type_aware.t b/t/update/type_aware.t index 05f86c3..fd58319 100644 --- a/t/update/type_aware.t +++ b/t/update/type_aware.t @@ -1,5 +1,5 @@ use strict; -use warnings; +use warnings; use Test::More; use lib qw(t/lib); diff --git a/xt/eol.t b/xt/eol.t index e61ce41..a3d7d86 100644 --- a/xt/eol.t +++ b/xt/eol.t @@ -5,13 +5,6 @@ use Test::More; use lib 't/lib'; use DBICTest; -# Don't run tests for installs -if ( DBICTest::RunMode->is_plain ) { - plan( skip_all => "Author tests not required for installation" ); -} - -plan skip_all => 'Test::EOL very broken'; - require DBIx::Class; unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_eol') ) { my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_eol'); @@ -20,13 +13,11 @@ unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_eol') ) { : plan skip_all => "Test needs: $missing" } -TODO: { - local $TODO = 'Do not fix those yet - we have way too many branches out there, merging will be hell'; - Test::EOL::all_perl_files_ok({ trailing_whitespace => 1}, - qw/t xt lib script/, - DBICTest::RunMode->is_author ? ('maint') : (), - ); -} +Test::EOL::all_perl_files_ok({ trailing_whitespace => 1 }, + qw/t xt lib script/, + DBICTest::RunMode->is_author ? ('maint') : (), +); -# FIXME - need to fix Test::EOL +# FIXME - Test::EOL declares 'no_plan' which conflicts with done_testing +# https://github.com/schwern/test-more/issues/14 #done_testing; diff --git a/xt/notabs.t b/xt/notabs.t index 76895b2..beb623e 100644 --- a/xt/notabs.t +++ b/xt/notabs.t @@ -5,11 +5,6 @@ use Test::More; use lib 't/lib'; use DBICTest; -# Don't run tests for installs -if ( DBICTest::RunMode->is_plain ) { - plan( skip_all => "Author tests not required for installation" ); -} - require DBIx::Class; unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_notabs') ) { my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_notabs'); @@ -23,5 +18,6 @@ Test::NoTabs::all_perl_files_ok( DBICTest::RunMode->is_author ? ('maint') : (), ); -# FIXME - need to fix Test::NoTabs - doesn't work with done_testing +# FIXME - Test::NoTabs declares 'no_plan' which conflicts with done_testing +# https://github.com/schwern/test-more/issues/14 #done_testing; diff --git a/xt/pod.t b/xt/pod.t index 328a1ed..d1a6210 100644 --- a/xt/pod.t +++ b/xt/pod.t @@ -5,11 +5,6 @@ use Test::More; use lib qw(t/lib); use DBICTest; -# Don't run tests for installs -if ( DBICTest::RunMode->is_plain ) { - plan( skip_all => "Author tests not required for installation" ); -} - require DBIx::Class; unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_pod') ) { my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_pod'); diff --git a/xt/podcoverage.t b/xt/podcoverage.t index f67a2f0..0e07ece 100644 --- a/xt/podcoverage.t +++ b/xt/podcoverage.t @@ -7,11 +7,6 @@ use lib qw(t/lib); use DBICTest; use namespace::clean; -# Don't run tests for installs -if ( DBICTest::RunMode->is_plain ) { - plan( skip_all => "Author tests not required for installation" ); -} - require DBIx::Class; unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_podcoverage') ) { my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_podcoverage');