Bugzilla – Attachment 88374 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.65 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-04-22 13:12:17 UTC
(
hide
)
Description:
Bug 22701: Unit tests for Koha::Biblio->items
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-04-22 13:12:17 UTC
Size:
1.65 KB
patch
obsolete
>From cbe8ce614b7a505728476115a7707aace112ea7e 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 >--- > 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.21.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 22701
:
88374
|
88375
|
88490
|
88491