Bugzilla – Attachment 48062 Details for
Bug 9021
Add SMS via email as an alternative to SMS services via SMS::Send drivers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9021 [QA Followup] - Unit tests
Bug-9021-QA-Followup---Unit-tests.patch (text/plain), 2.91 KB, created by
Jonathan Druart
on 2016-02-15 16:30:08 UTC
(
hide
)
Description:
Bug 9021 [QA Followup] - Unit tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-02-15 16:30:08 UTC
Size:
2.91 KB
patch
obsolete
>From 7a1db033f72e8740f41ec2f6b1d536a186ab57f2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 11 Feb 2016 06:53:15 +0000 >Subject: [PATCH] Bug 9021 [QA Followup] - Unit tests > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/SMS_Providers.t | 75 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 75 insertions(+) > create mode 100644 t/db_dependent/Koha/SMS_Providers.t > >diff --git a/t/db_dependent/Koha/SMS_Providers.t b/t/db_dependent/Koha/SMS_Providers.t >new file mode 100644 >index 0000000..407363b >--- /dev/null >+++ b/t/db_dependent/Koha/SMS_Providers.t >@@ -0,0 +1,75 @@ >+#!/usr/bin/perl >+ >+# Copyright 2016 ByWater Solutions >+# >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 6; >+ >+use Koha::Database; >+use Koha::SMS::Provider; >+use Koha::SMS::Providers; >+ >+use t::lib::TestBuilder; >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+my $count = Koha::SMS::Providers->search->count; >+ >+my $builder = t::lib::TestBuilder->new; >+my $provider1 = >+ Koha::SMS::Provider->new( { name => 'Test 1', domain => 'test1.com' } ) >+ ->store(); >+my $provider2 = >+ Koha::SMS::Provider->new( { name => 'Test 2', domain => 'test2.com' } ) >+ ->store(); >+ >+my $patron1 = $builder->build( >+ { >+ source => 'Borrower', >+ value => { sms_provider_id => $provider1->id, } >+ } >+); >+ >+my $patron2 = $builder->build( >+ { >+ source => 'Borrower', >+ value => { sms_provider_id => $provider1->id, } >+ } >+); >+ >+like( $provider1->id, qr|^\d+$|, >+ 'Adding a new provider should have set the id' ); >+is( Koha::SMS::Providers->search->count, >+ $count + 2, 'The 2 providers should have been added' ); >+ >+is ( $provider1->patrons_using(), 2, 'Found the correct number of patrons using provider' ); >+is ( $provider2->patrons_using(), 0, 'Found the correct number of patrons using unused provider' ); >+ >+my $provider = Koha::SMS::Providers->find( $provider1->id ); >+is( $provider->name, $provider1->name, >+ 'Find a provider by id should return the correct provider' ); >+ >+$provider1->delete; >+is( Koha::SMS::Providers->search->count, >+ $count + 1, 'Delete should have deleted the provider' ); >+ >+$schema->storage->txn_rollback; >+ >+1; >-- >2.7.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 9021
:
13290
|
13291
|
13293
|
13294
|
14166
|
14167
|
14363
|
15685
|
15687
|
15689
|
15691
|
16628
|
17311
|
21729
|
22478
|
28488
|
29927
|
32453
|
34180
|
34181
|
35816
|
40720
|
44331
|
45152
|
46163
|
46164
|
46165
|
46168
|
46169
|
46170
|
46171
|
47128
|
47129
|
47130
|
47133
|
47134
|
47135
|
47338
|
47339
|
47814
|
47815
|
47816
|
47817
|
47818
|
47845
|
47846
|
47847
|
47848
|
47995
|
48024
|
48025
|
48026
|
48027
|
48028
|
48029
|
48030
|
48031
|
48032
|
48033
|
48034
|
48035
|
48036
|
48052
|
48053
|
48054
|
48055
|
48056
|
48057
|
48058
|
48059
|
48060
|
48061
| 48062 |
48063
|
48064
|
48065
|
48066