Bugzilla – Attachment 154642 Details for
Bug 32942
Suggestion API doesn't support custom statuses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32942: (QA follow-up) Add tests for STATUS checking in Suggestion::store
Bug-32942-QA-follow-up-Add-tests-for-STATUS-checki.patch (text/plain), 1.58 KB, created by
Arthur Suzuki
on 2023-08-18 11:32:08 UTC
(
hide
)
Description:
Bug 32942: (QA follow-up) Add tests for STATUS checking in Suggestion::store
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2023-08-18 11:32:08 UTC
Size:
1.58 KB
patch
obsolete
>From ec31664514f2312a292a4abc77b923b746e962b8 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Fri, 18 Aug 2023 13:11:45 +0200 >Subject: [PATCH] Bug 32942: (QA follow-up) Add tests for STATUS checking in > Suggestion::store > >--- > t/db_dependent/Koha/Suggestions.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Suggestions.t b/t/db_dependent/Koha/Suggestions.t >index ae95ebe274..1e987acbc2 100755 >--- a/t/db_dependent/Koha/Suggestions.t >+++ b/t/db_dependent/Koha/Suggestions.t >@@ -49,7 +49,7 @@ my $new_suggestion_2 = Koha::Suggestion->new( > )->store; > > subtest 'store' => sub { >- plan tests => 3; >+ plan tests => 5; > my $suggestion = Koha::Suggestion->new( > { suggestedby => $patron->{borrowernumber}, > biblionumber => $biblio_1->biblionumber, >@@ -65,6 +65,18 @@ subtest 'store' => sub { > $suggestion->reason('because!')->store; > $suggestion = Koha::Suggestions->find( $suggestion->suggestionid ); > is( $suggestion->suggesteddate, $two_days_ago_sql, 'If suggestion id modified, suggesteddate should not be modified' ); >+ >+ throws_ok { >+ $suggestion->STATUS('UNKNOWN')->store; >+ } >+ 'Koha::Exceptions::Suggestion::StatusForbidden', >+ 'store raises an exception on invalid STATUS'; >+ >+ >+ my $authorised_value = Koha::AuthorisedValue->new({category => 'SUGGEST_STATUS', >+ authorised_value => 'UNKNOWN'})->store; >+ $suggestion->STATUS('UNKNOWN')->store; >+ is($suggestion->STATUS,'UNKNOWN',"UNKNOWN status stored"); > $suggestion->delete; > }; > >-- >2.40.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 32942
:
146508
|
146592
|
146593
|
146594
|
154642
|
154643
|
155801
|
155802
|
155803
|
155804
|
155805
|
155806
|
155900
|
155901
|
155902
|
155903
|
155904
|
155905
|
155906