Bugzilla – Attachment 146708 Details for
Bug 12029
Patrons should be able to delete their patron messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12029: Tests
Bug-12029-Tests.patch (text/plain), 1.99 KB, created by
Aleisha Amohia
on 2023-02-16 02:27:35 UTC
(
hide
)
Description:
Bug 12029: Tests
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-02-16 02:27:35 UTC
Size:
1.99 KB
patch
obsolete
>From de6e7742a65e867b245f4c80c13e8082951828fa Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 15 Feb 2023 21:56:35 +1300 >Subject: [PATCH] Bug 12029: Tests > >--- > t/db_dependent/Koha/Patron/Messages.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron/Messages.t b/t/db_dependent/Koha/Patron/Messages.t >index 06de4d29341..69a4bb428b7 100755 >--- a/t/db_dependent/Koha/Patron/Messages.t >+++ b/t/db_dependent/Koha/Patron/Messages.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 14; > > use C4::Context; > use Koha::ActionLogs; >@@ -27,6 +27,7 @@ use Koha::Patron::Message; > use Koha::Patron::Messages; > use Koha::Patrons; > use Koha::Database; >+use Koha::DateUtils qw( dt_from_string ); > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -99,6 +100,21 @@ $new_message_2->delete; > is( Koha::Patron::Messages->search->count, $nb_of_messages + 1, 'Delete should have deleted the message 2' ); > is( get_nb_of_logactions(), $nb_of_logaction + 3, 'With BorrowersLog on, 1 new log should have been added when deleting a new message' ); > >+my $new_message_4 = Koha::Patron::Message->new( >+ { borrowernumber => $patron->{borrowernumber}, >+ branchcode => $library->{branchcode}, >+ message_type => 'B', >+ message => 'my message 2', >+ manager_id => $patron_3->{borrowernumber}, >+ } >+)->store; >+my $patron_obj = Koha::Patrons->find( $patron->{borrowernumber} ); >+my $current_messages_count = $patron_obj->messages->count; >+is( $patron_obj->messages->filter_by_unread->count, $current_messages_count, "No messages have been marked as read" ); >+$new_message_4->update({ patron_read_date => dt_from_string }); >+is( $patron_obj->messages->filter_by_unread->count, $current_messages_count - 1, "One message has been marked as read" ); >+$new_message_4->update({ patron_read_date => undef }); >+ > $schema->storage->txn_rollback; > > sub get_nb_of_logactions { >-- >2.11.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 12029
:
130514
|
130515
|
130516
|
132918
|
132949
|
137434
|
137435
|
137518
|
137519
|
137520
|
137521
|
137522
|
137523
|
137646
|
137647
|
137648
|
146706
|
146707
|
146708
|
146709
|
147521
|
147522
|
147523
|
147524
|
147525
|
148607
|
148608
|
148609
|
148610
|
148611