Bugzilla – Attachment 88490 Details for
Bug 22701
Make items prefetchable from Koha::Biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22701: Unit tests for Koha::Biblio->items
Bug-22701-Unit-tests-for-KohaBiblio-items.patch (text/plain), 1.71 KB, created by
Martin Renvoize (ashimema)
on 2019-04-23 14:25:21 UTC
(
hide
)
Description:
Bug 22701: Unit tests for Koha::Biblio->items
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-23 14:25:21 UTC
Size:
1.71 KB
patch
obsolete
>From f4297e79bdd24985e7b317472f8daf5296b9b34e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sat, 20 Apr 2019 09:47:43 -0300 >Subject: [PATCH] Bug 22701: Unit tests for Koha::Biblio->items > >This patch adds tests fr the current items() implementation. The idea is >to verify no behaviour change takes place after we make it us >_new_from_dbic instead of calling Koha::Items->search. > >To test: >- Run: > $ kshell > k$ prove t/db_dependent/Koha/Biblio.t >=> SUCCESS: Tests pass! >- Sign off :-D > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Biblio.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 72c06e04f9..1e050ca68d 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > > use t::lib::TestBuilder; > >@@ -86,3 +86,24 @@ subtest 'hidden_in_opac() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'items() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ >+ my $items = $biblio->items; >+ is( ref($items), 'Koha::Items', 'Returns a Koha::Items resultset' ); >+ is( $items->count, 2, 'Two items in resultset' ); >+ >+ my @items = $biblio->items; >+ is( scalar @items, 2, 'Same result, but in list context' ); >+ >+ $schema->storage->txn_rollback; >+ >+}; >-- >2.20.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 22701
:
88374
|
88375
| 88490 |
88491