Bugzilla – Attachment 154993 Details for
Bug 34609
Holds history errors 500 if old_reserves.biblionumber is NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34609: Add tests
Bug-34609-Add-tests.patch (text/plain), 1.81 KB, created by
Jonathan Druart
on 2023-08-31 07:10:07 UTC
(
hide
)
Description:
Bug 34609: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-08-31 07:10:07 UTC
Size:
1.81 KB
patch
obsolete
>From 5c279e3e7954a2646bf8f25519a5322a6f519969 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 30 Aug 2023 13:13:04 +0000 >Subject: [PATCH] Bug 34609: Add tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Old/Hold.t | 40 +++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Old/Hold.t b/t/db_dependent/Koha/Old/Hold.t >index 91ed7a71c28..d62a3136fc5 100755 >--- a/t/db_dependent/Koha/Old/Hold.t >+++ b/t/db_dependent/Koha/Old/Hold.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 1; >+use Test::More tests => 2; > use Test::Exception; > > use Koha::Database; >@@ -80,3 +80,41 @@ subtest 'anonymize() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'biblio() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $hold_1 = $builder->build_object( >+ { >+ class => 'Koha::Old::Holds', >+ value => { biblionumber => undef } >+ } >+ ); >+ >+ is( $hold_1->biblio, undef, 'Old hold has no biblionumber, returns undef' ); >+ >+ my $hold_2 = $builder->build_object( >+ { >+ class => 'Koha::Old::Holds', >+ value => { biblionumber => '' } >+ } >+ ); >+ >+ is( $hold_1->biblio, undef, 'Old hold has empty biblionumber, returns undef' ); >+ >+ my $biblio = $builder->build_object( { class => 'Koha::Biblios' } ); >+ >+ my $hold_3 = $builder->build_object( >+ { >+ class => 'Koha::Old::Holds', >+ value => { biblionumber => $biblio->biblionumber } >+ } >+ ); >+ >+ is_deeply( $hold_3->biblio->unblessed, $biblio->unblessed, 'Old hold has a biblionumber, returns a biblio object' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.25.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 34609
:
154738
|
154901
|
154952
|
154953
|
154954
| 154993 |
154994
|
154995