Bugzilla – Attachment 182517 Details for
Bug 39917
Display a prompt for status alias when completing a request if ILL_STATUS_ALIAS in use
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39917: Add tests
Bug-39917-Add-tests.patch (text/plain), 2.54 KB, created by
Pedro Amorim
on 2025-05-16 11:50:16 UTC
(
hide
)
Description:
Bug 39917: Add tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-05-16 11:50:16 UTC
Size:
2.54 KB
patch
obsolete
>From 7bfe8fd86467f489a397435e10856b9c5f5b7209 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Fri, 16 May 2025 11:40:25 +0000 >Subject: [PATCH] Bug 39917: Add tests > >prove t/db_dependent/Koha/ILL/Requests.t >--- > t/db_dependent/Koha/ILL/Requests.t | 55 ++++++++++++++++++++++++++++-- > 1 file changed, 53 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/ILL/Requests.t b/t/db_dependent/Koha/ILL/Requests.t >index a60d099aa25..2f6f8a36690 100755 >--- a/t/db_dependent/Koha/ILL/Requests.t >+++ b/t/db_dependent/Koha/ILL/Requests.t >@@ -51,7 +51,7 @@ use_ok('Koha::ILL::Requests'); > > subtest 'Basic object tests' => sub { > >- plan tests => 24; >+ plan tests => 27; > > $schema->storage->txn_begin; > >@@ -160,7 +160,58 @@ subtest 'Basic object tests' => sub { > $illrq_obj->status, 'COMP', > "ILL is not currently marked complete." > ); >- $illrq_obj->mark_completed; >+ >+ my $backend = Test::MockObject->new; >+ $backend->set_isa('Koha::Illbackends::Mock'); >+ $backend->set_always( 'name', 'Mock' ); >+ $backend->mock( 'capabilities', sub { return 'Mock'; } ); >+ >+ my $config = Test::MockObject->new; >+ $config->set_always( 'backend_dir', "/tmp" ); >+ >+ $illrq_obj->_config($config); >+ $illrq_obj->_backend($backend); >+ >+ my $cat = Koha::AuthorisedValueCategories->search( { category_name => 'ILL_STATUS_ALIAS' } ); >+ >+ if ( $cat->count == 0 ) { >+ $cat = $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValueCategory', >+ value => { category_name => 'ILL_STATUS_ALIAS' } >+ } >+ ); >+ } >+ >+ my $av = $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValues', >+ value => { category => 'ILL_STATUS_ALIAS' } >+ } >+ ); >+ >+ my $mark_comp_return = $illrq_obj->mark_completed; >+ >+ isnt( >+ $illrq_obj->status, 'COMP', >+ "ILL_STATUS_ALIAS is not empty. ILL is not immediatelly complete." >+ ); >+ >+ is( >+ $mark_comp_return->{method}, 'mark_completed', >+ "ILL_STATUS_ALIAS is not empty. Rendering 'mark_completed' view" >+ ); >+ >+ Koha::AuthorisedValues->search( { 'category' => 'ILL_STATUS_ALIAS' } )->delete; >+ >+ $mark_comp_return = $illrq_obj->mark_completed; >+ >+ is_deeply( >+ $mark_comp_return, >+ { next => 'illview', stage => 'commit' }, >+ "ILL_STATUS_ALIAS is empty. Skip 'complete' view and go straight to illview" >+ ); >+ > is( > $illrq_obj->status, 'COMP', > "ILL is now marked complete." >-- >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 39917
:
182517
|
182518
|
182541
|
183091
|
183092
|
183093