Lines 18-24
Link Here
|
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use Test::More tests => 85; |
21 |
use Test::More tests => 86; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
use Test::Exception; |
24 |
use Test::Exception; |
Lines 905-910
EOF
Link Here
|
905 |
is( $items_content, $expected_items_content, 'get_item_content should return correct items info without time (if dateonly => 1)' ); |
905 |
is( $items_content, $expected_items_content, 'get_item_content should return correct items info without time (if dateonly => 1)' ); |
906 |
}; |
906 |
}; |
907 |
|
907 |
|
|
|
908 |
subtest 'Test content_not_like parameter for SendQueuedMessages' => sub { |
909 |
plan tests => 1; |
910 |
|
911 |
my $dbh = C4::Context->dbh; |
912 |
|
913 |
my $borrowernumber = Koha::Patron->new({ |
914 |
firstname => 'Jane', |
915 |
surname => 'Smith', |
916 |
categorycode => $patron_category, |
917 |
branchcode => $library->{branchcode}, |
918 |
dateofbirth => $date, |
919 |
smsalertnumber => undef, |
920 |
})->store->borrowernumber; |
921 |
|
922 |
$dbh->do(q|DELETE FROM message_queue|); |
923 |
$my_message = { |
924 |
'letter' => { |
925 |
'content' => 'a message', |
926 |
'metadata' => 'metadata', |
927 |
'code' => 'TEST_MESSAGE', |
928 |
'content_type' => 'text/plain', |
929 |
'title' => 'message title' |
930 |
}, |
931 |
'borrowernumber' => $borrowernumber, |
932 |
'to_address' => undef, |
933 |
'message_transport_type' => 'sms', |
934 |
'from_address' => 'from@example.com' |
935 |
}; |
936 |
my $my_message2 = { |
937 |
'letter' => { |
938 |
'content' => 'another message', |
939 |
'metadata' => 'metadata', |
940 |
'code' => 'TEST_MESSAGE', |
941 |
'content_type' => 'text/plain', |
942 |
'title' => 'message title' |
943 |
}, |
944 |
'borrowernumber' => $borrowernumber, |
945 |
'to_address' => undef, |
946 |
'message_transport_type' => 'sms', |
947 |
'from_address' => 'from@example.com' |
948 |
}; |
949 |
my $my_message3 = { |
950 |
'letter' => { |
951 |
'content' => 'a skipped message', |
952 |
'metadata' => 'metadata', |
953 |
'code' => 'TEST_MESSAGE', |
954 |
'content_type' => 'text/plain', |
955 |
'title' => 'message title' |
956 |
}, |
957 |
'borrowernumber' => $borrowernumber, |
958 |
'to_address' => undef, |
959 |
'message_transport_type' => 'sms', |
960 |
'from_address' => 'from@example.com' |
961 |
}; |
962 |
C4::Letters::EnqueueLetter($my_message); |
963 |
C4::Letters::EnqueueLetter($my_message2); |
964 |
C4::Letters::EnqueueLetter($my_message3); |
965 |
my $messages_processed = C4::Letters::SendQueuedMessages( { content_not_like => 'skipped' } ); |
966 |
is( $messages_processed, 2, "Correctly skipped processing one message containing the work 'skipped' in contents" ); |
967 |
}; |
968 |
|
908 |
subtest 'Test limit parameter for SendQueuedMessages' => sub { |
969 |
subtest 'Test limit parameter for SendQueuedMessages' => sub { |
909 |
plan tests => 3; |
970 |
plan tests => 3; |
910 |
|
971 |
|
911 |
- |
|
|