Bugzilla – Attachment 29155 Details for
Bug 12455
The module C4/SMS.pm needs more unit tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12455: adding unit tests for the module C4/SMS.pm
SIGNED-OFF-Bug-12455-adding-unit-tests-for-the-mod.patch (text/plain), 2.12 KB, created by
Bernardo Gonzalez Kriegel
on 2014-06-23 00:38:37 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12455: adding unit tests for the module C4/SMS.pm
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-06-23 00:38:37 UTC
Size:
2.12 KB
patch
obsolete
>From 13a4330fa77187c00f090f855b2ad82584bb2c53 Mon Sep 17 00:00:00 2001 >From: Yohann Dufour <dufour.yohann@gmail.com> >Date: Fri, 20 Jun 2014 10:42:13 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12455: adding unit tests for the module > C4/SMS.pm > >The module C4/SMS.pm was not tested > >Test plan: >1/ Execute the command : prove t/SMS.t >2/ The result has to be a success without error or warning : >t/SMS.t .. ok >All tests successful. >Files=1, Tests=7, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.17 cusr 0.02 csys = 0.23 CPU) >Result: PASS > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Replace stub test, all test pass. >Removed "use strict/warnings", no need for that with "use Modern::Perl" >No koha-qa errors >--- > t/SMS.t | 44 +++++++++++++++++++++++++++++++++++++------- > 1 file changed, 37 insertions(+), 7 deletions(-) > >diff --git a/t/SMS.t b/t/SMS.t >index d88633f..ab1d374 100755 >--- a/t/SMS.t >+++ b/t/SMS.t >@@ -1,14 +1,44 @@ > #!/usr/bin/perl >-# >-# This Koha test module is a stub! >-# Add more tests here!!! > >-use strict; >-use warnings; >+use Modern::Perl; > >-use Test::More tests => 1; >+use t::lib::Mocks; >+ >+use Test::More tests => 7; > > BEGIN { >- use_ok('C4::SMS'); >+ use_ok('C4::SMS'); > } > >+ >+my $driver = 'my mock driver'; >+t::lib::Mocks::mock_preference('SMSSendDriver', $driver); >+is( C4::SMS->driver(), $driver, 'driver returns the SMSSendDriver correctly' ); >+ >+ >+my $send_sms = C4::SMS->send_sms(); >+is( $send_sms, undef, 'send_sms without arguments returns undef' ); >+ >+$send_sms = C4::SMS->send_sms({ >+ destination => 'my destination', >+}); >+is( $send_sms, undef, 'send_sms without message returns undef' ); >+ >+$send_sms = C4::SMS->send_sms({ >+ message => 'my message', >+}); >+is( $send_sms, undef, 'send_sms without destination returns undef' ); >+ >+$send_sms = C4::SMS->send_sms({ >+ destination => 'my destination', >+ message => 'my message', >+ driver => '', >+}); >+is( $send_sms, undef, 'send_sms with an undef driver returns undef' ); >+ >+$send_sms = C4::SMS->send_sms({ >+ destination => '+33123456789', >+ message => 'my message', >+ driver => 'Test', >+}); >+is( $send_sms, 1, 'send_sms returns 1' ); >-- >1.9.1
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 12455
:
29086
|
29155
|
29184
|
29379