Bugzilla – Attachment 97935 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.68 KB, created by
Agustín Moyano
on 2020-01-25 03:13:16 UTC
(
hide
)
Description:
Bug 24356: prefetch_whitelist tests
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2020-01-25 03:13:16 UTC
Size:
2.68 KB
patch
obsolete
>From 7ddea1ca484d4493c233eebaaf557f5bad48e3f5 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 >--- > t/db_dependent/Koha/Object.t | 26 +++++++++++++++++++++++++- > t/db_dependent/Koha/Objects.t | 27 +++++++++++++++++++++++++-- > 2 files changed, 50 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index bcee55ca75..512b4f7815 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 => 17; >+use Test::More tests => 18; > use Test::Exception; > use Test::Warn; > use DateTime; >@@ -26,6 +26,7 @@ use C4::Context; > use C4::Circulation; # AddIssue > use C4::Biblio; # AddBiblio > >+use Koha::Acquisition::Baskets; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Libraries; >@@ -737,3 +738,26 @@ subtest 'unblessed_all_relateds' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'prefetch_whitelist() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $basket = Koha::Acquisition::Basket->new; >+ >+ my $prefetch_whitelist = $basket->prefetch_whitelist; >+ >+ ok( >+ exists $prefetch_whitelist->{basket_group}, >+ 'Relationship matching method name is listed' >+ ); >+ is( >+ $prefetch_whitelist->{basket_group}, >+ 'Koha::Acquisition::BasketGroup', >+ '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..566f1941fd 100644 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 20; >+use Test::More tests => 21; > use Test::Exception; > use Test::Warn; > >@@ -783,4 +783,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 $baskets = Koha::Acquisition::Baskets->new; >+ >+ my $prefetch_whitelist = $baskets->prefetch_whitelist; >+ >+ ok( >+ exists $prefetch_whitelist->{basket_group}, >+ 'Relationship matching method name is listed' >+ ); >+ is( >+ $prefetch_whitelist->{basket_group}, >+ 'Koha::Acquisition::BasketGroup', >+ 'Guessed the object class correctly' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.17.1
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