Bugzilla – Attachment 175904 Details for
Bug 38751
Creating ILL request through OPAC openURL explodes if same attribute defined twice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38751: Add tests
Bug-38751-Add-tests.patch (text/plain), 2.24 KB, created by
David Nind
on 2024-12-22 22:05:50 UTC
(
hide
)
Description:
Bug 38751: Add tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-12-22 22:05:50 UTC
Size:
2.24 KB
patch
obsolete
>From cdc20ac48f14e7301fd4f1d94699328cc1de176b Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 19 Dec 2024 11:57:55 +0000 >Subject: [PATCH] Bug 38751: Add tests > >prove t/db_dependent/Koha/ILL/Request.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Koha/ILL/Request.t | 49 ++++++++++++++++++++++++++++++- > 1 file changed, 48 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/ILL/Request.t b/t/db_dependent/Koha/ILL/Request.t >index fe8f1631c9..4a35b1cf2f 100755 >--- a/t/db_dependent/Koha/ILL/Request.t >+++ b/t/db_dependent/Koha/ILL/Request.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::MockModule; > > use Koha::ILL::Requests; >@@ -68,6 +68,53 @@ subtest 'patron() tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'extended_attributes() tests' => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $request = $builder->build_object( { class => 'Koha::ILL::Requests' } ); >+ >+ is( >+ $request->extended_attributes->count, 0, >+ 'extended_attributes() returns empty if no extended attributes are set' >+ ); >+ >+ my $attribute = $builder->build_object( >+ { >+ class => 'Koha::ILL::Request::Attributes', >+ value => { >+ illrequest_id => $request->illrequest_id, >+ type => 'custom_attribute', >+ value => 'custom_value' >+ } >+ } >+ ); >+ >+ is_deeply( >+ $request->extended_attributes->next, $attribute, >+ 'extended_attributes() returns empty if no extended attributes are set' >+ ); >+ >+ $request->extended_attributes([ >+ { type => 'type', value => 'type_value' }, >+ { type => 'type2', value => 'type2_value' }, >+ ]); >+ >+ is( >+ $request->extended_attributes->count, 3, >+ 'extended_attributes() returns the correct amount of attributes' >+ ); >+ >+ is( >+ $request->extended_attributes->find({ type => 'type' })->value, 'type_value', >+ 'extended_attributes() contains the correct attribute' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'get_type_disclaimer_value() tests' => sub { > > plan tests => 2; >-- >2.39.5
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 38751
:
175700
|
175701
|
175702
|
175703
|
175704
|
175705
|
175903
|
175904
|
175905
|
176124
|
176250
|
176251
|
176252
|
176253