Skip to content

Commit add5a19

Browse files
Merge pull request #1 from sonntagd/bug/cm_telecom_api_change
cm telecom api change
2 parents b807f69 + 67656a3 commit add5a19

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

t/02-sms.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plan tests => 4;
99

1010
subtest no_product_token => sub {
1111
plan tests => 2;
12-
12+
1313
my $sms = eval { SMS::API::CMTelecom->new() };
1414
like $@, qr'^SMS::API::CMTelecom->new requires product_token parameter', 'correct error message';
1515
ok !$sms, 'creating SMS object failed';
@@ -22,7 +22,7 @@ subtest simple_object_creation => sub {
2222
);
2323

2424
is ref $sms, 'SMS::API::CMTelecom', 'SMS object created';
25-
25+
2626
subtest no_sender_given => sub {
2727
plan tests => 2;
2828

@@ -118,5 +118,5 @@ subtest wrong_product_token => sub {
118118
reference => 293854,
119119
);
120120
is $res, undef, 'undef returned';
121-
is $sms->error_message, 'No account found for the given authentication', 'correct error message';
121+
is $sms->error_message, 'No authentication method found.', 'correct error message';
122122
};

t/03-sms-real.t

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ subtest simple_message => sub {
3030
);
3131

3232
is ref $sms, 'SMS::API::CMTelecom', 'SMS object created';
33-
33+
3434
my $res = $sms->send(
3535
message => 'This is a test of the Perl module SMS::API::CMTelecom :-)',
3636
recipients => $phone_number,
@@ -40,11 +40,12 @@ subtest simple_message => sub {
4040
is_deeply $res, {
4141
messages => [
4242
{
43-
to => clean_number($phone_number),
44-
parts => 1,
45-
reference => undef,
46-
messageDetails => undef,
47-
status => 'Accepted',
43+
to => clean_number($phone_number),
44+
parts => 1,
45+
reference => undef,
46+
messageDetails => undef,
47+
status => 'Accepted',
48+
messageErrorCode => 0,
4849
},
4950
],
5051
}, 'correct status information';
@@ -61,7 +62,7 @@ subtest simple_message_with_reference => sub {
6162
is ref $sms, 'SMS::API::CMTelecom', 'SMS object created';
6263
my @chars = (0..9, 'A'..'Z', 'a'..'z');
6364
my $reference = join "" => map { $chars[int rand @chars] } 1..(1+int(rand 32));
64-
65+
6566
my $res = $sms->send(
6667
message => 'This is a test of the Perl module SMS::API::CMTelecom :-)',
6768
recipients => $phone_number,
@@ -72,11 +73,12 @@ subtest simple_message_with_reference => sub {
7273
is_deeply $res, {
7374
messages => [
7475
{
75-
to => clean_number($phone_number),
76-
parts => 1,
77-
reference => $reference,
78-
messageDetails => undef,
79-
status => 'Accepted',
76+
to => clean_number($phone_number),
77+
parts => 1,
78+
reference => $reference,
79+
messageDetails => undef,
80+
status => 'Accepted',
81+
messageErrorCode => 0,
8082
},
8183
],
8284
}, "correct status information with included reference ($reference)";
@@ -87,4 +89,4 @@ sub clean_number {
8789
my $num = shift;
8890
$num =~ s/\D//g;
8991
return $num;
90-
}
92+
}

t/05-sms-send-send.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ subtest send_real => sub {
4141
text => 'You message may use more than 160 chars.',
4242
to => $ENV{SMS_CMTELECOM_PHONE_NUMBER},
4343
_from => $ENV{SMS_CMTELECOM_PHONE_NUMBER},
44-
_reference => 'SMS::Send::CMTelecom test',
44+
reference => 'SMS::Send::CMTelecom test',
4545
);
4646

4747
is $sent, 1, 'message successfully sent';
4848

49-
};
49+
};

0 commit comments

Comments
 (0)