Bugzilla – Attachment 97858 Details for
Bug 24149
Add new Koha::Statistic[s] classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24149: Skip Koha::Statistics for TestBuilder tests
Bug-24149-Skip-KohaStatistics-for-TestBuilder-test.patch (text/plain), 1.86 KB, created by
Jonathan Druart
on 2020-01-24 08:45:31 UTC
(
hide
)
Description:
Bug 24149: Skip Koha::Statistics for TestBuilder tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-24 08:45:31 UTC
Size:
1.86 KB
patch
obsolete
>From 87ee59649506125db0bd72b34e0515d7689b98d1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 24 Jan 2020 09:44:04 +0100 >Subject: [PATCH] Bug 24149: Skip Koha::Statistics for TestBuilder tests > >As statistics does not have a PK we need to adjust the TestBuilder >tests. >Bug 18441 already exists for adding the PK. >--- > t/db_dependent/TestBuilder.t | 2 +- > t/lib/TestBuilder.pm | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/TestBuilder.t b/t/db_dependent/TestBuilder.t >index 593a596e09..0050463e34 100644 >--- a/t/db_dependent/TestBuilder.t >+++ b/t/db_dependent/TestBuilder.t >@@ -395,7 +395,7 @@ subtest 'build_object() tests' => sub { > eval "require $module"; > my $object = $builder->build_object( { class => $module } ); > is( ref($object), $module->object_class, "Testing $module" ); >- if ( $module ne 'Koha::Old::Patrons' ) { # FIXME deletedborrowers does not have a PK >+ if ( ! grep {$module eq $_ } qw( Koha::Old::Patrons Koha::Statistics ) ) { # FIXME deletedborrowers and statistics do not have a PK > eval {$object->get_from_storage}; > is( $@, '', "Module $module should have koha_object[s]_class method if needed" ); > } >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index cceacc1257..fd25f44a30 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -86,6 +86,8 @@ sub build_object { > my $object; > if ( $class eq 'Koha::Old::Patrons' ) { > $object = $class->search({ borrowernumber => $hashref->{borrowernumber} })->next; >+ } elsif ( $class eq 'Koha::Statistics' ) { >+ $object = $class->search({ datetime => $hashref->{datetime} })->next; > } else { > my @ids; > my @pks = $self->schema->source( $class->_type )->primary_columns; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24149
:
95956
|
95957
|
95958
|
97239
|
97776
|
97777
|
97778
|
97779
| 97858