Bugzilla – Attachment 48015 Details for
Bug 15632
Move the messages related code to Koha::Patron::Messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15632: Koha::Patron::Messages - Remove tests
Bug-15632-KohaPatronMessages---Remove-tests.patch (text/plain), 4.39 KB, created by
Kyle M Hall (khall)
on 2016-02-12 19:05:30 UTC
(
hide
)
Description:
Bug 15632: Koha::Patron::Messages - Remove tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-12 19:05:30 UTC
Size:
4.39 KB
patch
obsolete
>From dcc5214b9ae299078e8c9d8c0b0ba1de43721cbf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jan 2016 18:28:40 +0000 >Subject: [PATCH] Bug 15632: Koha::Patron::Messages - Remove tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The messages related tests in t/db_dependent/Members.t are not >deprecated and can be removed. > >Test plan: > git grep AddMessage > git grep DeleteMessage > git grep GetMessagesCount > git grep GetMessages >should not return any result. > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > t/db_dependent/Members.t | 46 +--------------------------------------------- > 1 file changed, 1 insertion(+), 45 deletions(-) > >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 4c87e84..6a010dd 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 74; >+use Test::More tests => 53; > use Test::MockModule; > use Data::Dumper; > use C4::Context; >@@ -164,50 +164,6 @@ ModMember(borrowernumber => $member->{'borrowernumber'}, dateexpiry => '2001-01- > $member = GetMemberDetails($member->{'borrowernumber'}); > ok($member->{is_expired}, "GetMemberDetails() indicates that patron is expired"); > >- >-my $message_type = 'B'; >-my $message = 'my message'; >-my $messages_count = GetMessagesCount($member->{borrowernumber}, $message_type, $BRANCHCODE); >-is( $messages_count, 0, 'GetMessagesCount returns the number of messages correclty' ); >- >-is( AddMessage(), undef, 'AddMessage without argument returns undef' ); >-is( AddMessage(undef, $message_type, $message, $BRANCHCODE), undef, 'AddMessage without the borrower number returns undef' ); >-is( AddMessage($member->{borrowernumber}, undef, $message, $BRANCHCODE), undef, 'AddMessage without the message type returns undef' ); >-is( AddMessage($member->{borrowernumber}, $message_type, undef, $BRANCHCODE), undef, 'AddMessage without the message returns undef' ); >-is( AddMessage($member->{borrowernumber}, $message_type, $message, undef), undef, 'AddMessage without the branch code returns undef' ); >-is( AddMessage($member->{borrowernumber}, $message_type, $message, $BRANCHCODE), 1, 'AddMessage functions correctly' ); >- >-$messages_count = GetMessagesCount(); >-is( $messages_count, 0, 'GetMessagesCount without argument returns 0' ); >-$messages_count = GetMessagesCount(undef, $message_type, $BRANCHCODE); >-is( $messages_count, '0', 'GetMessagesCount without the borrower number returns the number of messages' ); >-$messages_count = GetMessagesCount($member->{borrowernumber}, undef, $BRANCHCODE); >-is( $messages_count, '1', 'GetMessagesCount without the message type returns the total number of messages' ); >-$messages_count = GetMessagesCount($member->{borrowernumber}, $message_type, undef); >-is( $messages_count, '1', 'GetMessagesCount without the branchcode returns the total number of messages' ); >-$messages_count = GetMessagesCount($member->{borrowernumber}, $message_type, $BRANCHCODE); >-is( $messages_count, '1', 'GetMessagesCount returns the number of messages correctly' ); >- >-my $messages = GetMessages(); >-is( @$messages, 0, 'GetMessages without argument returns 0' ); >-$messages = GetMessages($member->{borrowernumber}, $message_type, $BRANCHCODE); >-is( @$messages, 1, 'GetMessages returns the correct number of messages' ); >-is( $messages->[0]->{borrowernumber}, $member->{borrowernumber}, 'GetMessages returns the borrower number correctly' ); >-is( $messages->[0]->{message_type}, $message_type, 'GetMessages returns the message type correclty' ); >-is( $messages->[0]->{message}, $message, 'GetMessages returns the message correctly' ); >-is( $messages->[0]->{branchcode}, $BRANCHCODE, 'GetMessages returns the branch code correctly' ); >- >-$messages_count = GetMessagesCount($member->{borrowernumber}, $message_type, $BRANCHCODE); >-is( $messages_count, 1, 'GetMessagesCount returns the number of messages correclty' ); >- >-DeleteMessage(); >-$messages = GetMessages($member->{borrowernumber}, $message_type, $BRANCHCODE); >-is( @$messages, 1, 'DeleteMessage without message id does not delete messages' ); >-DeleteMessage($messages->[0]->{message_id}); >-$messages = GetMessages($member->{borrowernumber}, $message_type, $BRANCHCODE); >-is( @$messages, 0, 'DeleteMessage deletes a message correctly' ); >- >- > # clean up > DelMember($member->{borrowernumber}); > my $borrower = GetMember( cardnumber => $CARDNUMBER ); >-- >2.1.4
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 15632
:
47091
|
47092
|
47093
|
47094
|
47095
|
47096
|
47097
|
47515
|
47516
|
47525
|
47571
|
47572
|
47573
|
47574
|
47575
|
47580
|
47581
|
47582
|
47583
|
47584
|
47585
|
47586
|
47587
|
48004
|
48009
|
48010
|
48011
|
48012
|
48013
|
48014
|
48015
|
48016
|
48017
|
48018
|
48020
|
48422
|
48423
|
48424
|
48425
|
48426
|
48427
|
48591
|
48592
|
48593