Bugzilla – Attachment 192022 Details for
Bug 39721
Remove GetSuggestion from C4/Suggestions.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39721: Add test for accepter
40876fa.patch (text/plain), 2.59 KB, created by
Jonathan Druart
on 2026-01-26 11:10:02 UTC
(
hide
)
Description:
Bug 39721: Add test for accepter
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-26 11:10:02 UTC
Size:
2.59 KB
patch
obsolete
>From 40876fa75918c0788afef19700b683c928589c66 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Fri, 23 Jan 2026 13:22:14 +0000 >Subject: [PATCH] Bug 39721: Add test for accepter > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Suggestions.t | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Suggestions.t b/t/db_dependent/Koha/Suggestions.t >index 7f5452291a0..bc28cec484b 100755 >--- a/t/db_dependent/Koha/Suggestions.t >+++ b/t/db_dependent/Koha/Suggestions.t >@@ -272,8 +272,8 @@ subtest 'constraints' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'manager, suggester, rejecter, last_modifier' => sub { >- plan tests => 8; >+subtest 'manager, suggester, accepter, rejecter, last_modifier' => sub { >+ plan tests => 11; > $schema->storage->txn_begin; > > my $suggestion = $builder->build_object( { class => 'Koha::Suggestions' } ); >@@ -288,6 +288,11 @@ subtest 'manager, suggester, rejecter, last_modifier' => sub { > 'Koha::Patron', > '->rejecter should have returned a Koha::Patron object' > ); >+ is( >+ ref( $suggestion->accepter ), >+ 'Koha::Patron', >+ '->accepter should have returned a Koha::Patron object' >+ ); > is( > ref( $suggestion->suggester ), > 'Koha::Patron', >@@ -303,6 +308,7 @@ subtest 'manager, suggester, rejecter, last_modifier' => sub { > { > managedby => undef, > rejectedby => undef, >+ acceptedby => undef, > suggestedby => undef, > lastmodificationby => undef > } >@@ -316,6 +322,10 @@ subtest 'manager, suggester, rejecter, last_modifier' => sub { > $suggestion->rejecter, undef, > '->rejecter should have returned undef if no rejecter set' > ); >+ is( >+ $suggestion->accepter, undef, >+ '->accepter should have returned undef if no rejecter set' >+ ); > is( > $suggestion->suggester, undef, > '->suggester should have returned undef if no suggester set' >@@ -326,6 +336,13 @@ subtest 'manager, suggester, rejecter, last_modifier' => sub { > '->last_modifier should have returned undef if no last_modifier set' > ); > >+ my $accepter = $builder->build_object( { class => 'Koha::Patrons' } ); >+ $suggestion->set( >+ { >+ acceptedby => $accepter->id, >+ } >+ ); >+ is( $suggestion->accepter->id, $accepter->id, 'Accepter correctly retrieved' ); > $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 39721
:
181402
|
181416
|
182810
|
185280
|
185281
|
185282
|
185283
|
188646
|
188648
|
188649
|
188650
|
188651
|
188652
|
190940
|
190941
|
191656
|
191657
|
191909
|
191910
|
191927
|
192020
|
192021
| 192022