From a93978c12fa455d66a3a79eff1b7a30c23179684 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 8 Jan 2025 16:31:28 +0000 Subject: [PATCH] Bug 37448: (QA follow-up) Move POD to make QA Script happy This particular script has POD at the end rather than inline POD. This patch simply moves the POD addition for this patchset into the bottom section. Signed-off-by: Martin Renvoize --- t/lib/TestBuilder.pm | 89 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 5aa1d0cdb7d..ec618ebffa7 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -210,25 +210,6 @@ sub build_sample_item { )->store->get_from_storage; } -=pod - -=head2 build_sample_ill_request - -Builds a sample ILL request with the supplied arguments. - -C<$args> is a hashref with the following optional keys: - -=over 4 - -=item * C (default: a new sample biblio created with L) - -=item * C (default: Standard) - -=item * C (default: a random branch) - -=back - -=cut sub build_sample_ill_request { my ( $self, $args ) = @_; @@ -239,7 +220,7 @@ sub build_sample_ill_request { return $self->build_object( { class => 'Koha::ILL::Requests', - value => $args, + value => $args, } )->store->get_from_storage; } @@ -751,13 +732,13 @@ Note that you should wrap these actions in a transaction yourself. my $builder = t::lib::TestBuilder->new; - Constructor - Returns the object TestBuilder +Constructor - Returns the object TestBuilder =head2 schema my $schema = $builder->schema; - Getter - Returns the schema of DBIx::Class +Getter - Returns the schema of DBIx::Class =head2 delete @@ -766,42 +747,60 @@ Note that you should wrap these actions in a transaction yourself. records => $patron, # OR: records => [ $patron, ... ], }); - Delete individual records, created by builder. - Returns the number of delete attempts, or undef. +Delete individual records, created by builder. +Returns the number of delete attempts, or undef. =head2 build $builder->build({ source => $source_name, value => $value }); - Create a test record in the table, represented by $source_name. - The name is required and must conform to the DBIx::Class schema. - Values may be specified by the optional $value hashref. Will be - randomized otherwise. - If needed, TestBuilder creates linked records for foreign keys. - Returns the values of the new record as a hashref, or undef if - the record could not be created. - - Note that build also supports recursive hash references inside the - value hash for foreign key columns, like: - value => { - column1 => 'some_value', - fk_col2 => { - columnA => 'another_value', - } +Create a test record in the table, represented by $source_name. +The name is required and must conform to the DBIx::Class schema. +Values may be specified by the optional $value hashref. Will be +randomized otherwise. +If needed, TestBuilder creates linked records for foreign keys. +Returns the values of the new record as a hashref, or undef if +the record could not be created. + +Note that build also supports recursive hash references inside the +value hash for foreign key columns, like: + value => { + column1 => 'some_value', + fk_col2 => { + columnA => 'another_value', } - The hash for fk_col2 here means: create a linked record with build - where columnA has this value. In case of a composite FK the hashes - are merged. + } +The hash for fk_col2 here means: create a linked record with build +where columnA has this value. In case of a composite FK the hashes +are merged. - Realize that passing primary key values to build may result in undef - if a record with that primary key already exists. +Realize that passing primary key values to build may result in undef +if a record with that primary key already exists. =head2 build_object + my $patron = $builder->build_object({ class => 'Koha::Patrons' [, value => { ... }] }); + Given a plural Koha::Object-derived class, it creates a random element, and returns the corresponding Koha::Object. - my $patron = $builder->build_object({ class => 'Koha::Patrons' [, value => { ... }] }); +=head2 build_sample_ill_request + + my $ill_request = $builder->build_sample_ill_request({ biblio_id => $biblio_id }); + +Builds a sample ILL request with the supplied arguments. + +C<$args> is a hashref with the following optional keys: + +=over 4 + +=item * C (default: a new sample biblio created with L) + +=item * C (default: Standard) + +=item * C (default: a random branch) + +=back =head1 AUTHOR -- 2.47.1