Bugzilla – Attachment 98353 Details for
Bug 24356
objects.search prefetch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24356: prefetch_whitelist tests
Bug-24356-prefetchwhitelist-tests.patch (text/plain), 2.60 KB, created by
David Nind
on 2020-02-03 17:13:27 UTC
(
hide
)
Description:
Bug 24356: prefetch_whitelist tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-02-03 17:13:27 UTC
Size:
2.60 KB
patch
obsolete
>From 9ef3b6990bce90a0047f1a9283177050b37cf924 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 21 Jan 2020 15:46:53 -0300 >Subject: [PATCH] Bug 24356: prefetch_whitelist tests > >This patch adds tests for the introduced methods. > >To test: >1. Run the tests :-D >=> SUCCESS: They pass! >2. Sign off :-D > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Koha/Object.t | 25 ++++++++++++++++++++++++- > t/db_dependent/Koha/Objects.t | 28 ++++++++++++++++++++++++++-- > 2 files changed, 50 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index 6679bd5567..9e54675f6d 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 18; >+use Test::More tests => 19; > use Test::Exception; > use Test::Warn; > use DateTime; >@@ -795,3 +795,26 @@ subtest 'get_from_storage' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'prefetch_whitelist() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = Koha::Biblio->new; >+ >+ my $prefetch_whitelist = $biblio->prefetch_whitelist; >+ >+ ok( >+ exists $prefetch_whitelist->{orders}, >+ 'Relationship matching method name is listed' >+ ); >+ is( >+ $prefetch_whitelist->{orders}, >+ 'Koha::Acquisition::Order', >+ 'Guessed the object class correctly' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index 27dd4490e4..68292dd0db 100644 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -19,12 +19,13 @@ > > use Modern::Perl; > >-use Test::More tests => 20; >+use Test::More tests => 21; > use Test::Exception; > use Test::Warn; > > use Koha::Authority::Types; > use Koha::Cities; >+use Koha::Biblios; > use Koha::IssuingRules; > use Koha::Patron::Category; > use Koha::Patron::Categories; >@@ -783,4 +784,27 @@ subtest "from_api_mapping() tests" => sub { > ); > > $schema->storage->txn_rollback; >-}; >\ No newline at end of file >+}; >+ >+subtest 'prefetch_whitelist() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblios = Koha::Biblios->new; >+ >+ my $prefetch_whitelist = $biblios->prefetch_whitelist; >+ >+ ok( >+ exists $prefetch_whitelist->{orders}, >+ 'Relationship matching method name is listed' >+ ); >+ is( >+ $prefetch_whitelist->{orders}, >+ 'Koha::Acquisition::Order', >+ 'Guessed the object class correctly' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >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 24356
:
97680
|
97681
|
97848
|
97849
|
97851
|
97852
|
97935
|
97936
|
98261
|
98262
|
98348
|
98353
|
98354
|
98543
|
98544
|
98602
|
98603
|
99349
|
99350