Bugzilla – Attachment 161056 Details for
Bug 35787
Remove Koha::Template::Plugin::Biblio::CanBook
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35787: Add unit test for filter_by_bookable
Bug-35787-Add-unit-test-for-filterbybookable.patch (text/plain), 1.67 KB, created by
Martin Renvoize (ashimema)
on 2024-01-16 09:49:23 UTC
(
hide
)
Description:
Bug 35787: Add unit test for filter_by_bookable
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-16 09:49:23 UTC
Size:
1.67 KB
patch
obsolete
>From 7a59118d1eba3f7bba9ad99fa7ad8213a0f10042 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 16 Jan 2024 09:47:10 +0000 >Subject: [PATCH] Bug 35787: Add unit test for filter_by_bookable > >Trivial test added for filter_by_bookable >--- > t/db_dependent/Koha/Items.t | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index 26f81dd7d4a..a7e1fc72c16 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 16; >+use Test::More tests => 17; > > use Test::MockModule; > use Test::Exception; >@@ -2000,3 +2000,26 @@ subtest 'filter_by_for_hold' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'filter_by_bookable' => sub { >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio; >+ >+ # bookable items >+ my $bookable_item1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, bookable => 1 } ); >+ >+ # not bookable items >+ my $non_bookable_item1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, bookable => 0 } ); >+ my $non_bookable_item2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, bookable => 0 } ); >+ >+ is( $biblio->items->filter_by_bookable->count, 1, "filter_by_bookable returns the correct number of items" ); >+ is( >+ $biblio->items->filter_by_bookable->next->itemnumber, $bookable_item1->itemnumber, >+ "the correct item is returned from filter_by_bookable" >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.43.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 35787
:
160960
|
161038
| 161056