Bugzilla – Attachment 38949 Details for
Bug 14147
Add unit tests to C4::External::OverDrive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 14147: Add unit tests to C4::External::OverDrive
SIGNED-OFF-Bug-14147-Add-unit-tests-to-C4ExternalO.patch (text/plain), 3.43 KB, created by
Bernardo Gonzalez Kriegel
on 2015-05-07 13:56:26 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 14147: Add unit tests to C4::External::OverDrive
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-05-07 13:56:26 UTC
Size:
3.43 KB
patch
obsolete
>From a04ff0dae8d34c19bd55563f45b1f75b183af3a9 Mon Sep 17 00:00:00 2001 >From: Julian FIOL <julian.fiol@biblibre.com> >Date: Tue, 5 May 2015 12:26:49 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 14147: Add unit tests to > C4::External::OverDrive > >This patch test 'IsOverDriveEnabled' subroutine > > TEST PLAN > --------- > 1. Apply patch > 2. prove -v t/External/OverDrive.t > -- All tests should run successfully without > any error or warning > > TEST PLAN OPTIONAL > ------------------ > > Check with bug 13899 to see the coverage of this module. > > Coverage BEFORE this patch : > Statement : 47,5% > Branch : 0,0% > Condition : 0,0% > Subroutine : 75,0% > > Coverage AFTER this patch : > Statement : 49,1% > Branch : 0,0% > Condition : 33,3% > Subroutine : 83,3% > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Tests tun, no koha-qa errors >--- > t/External/OverDrive.t | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ > t/External_Overdrive.t | 13 ------------ > 2 files changed, 55 insertions(+), 13 deletions(-) > create mode 100755 t/External/OverDrive.t > delete mode 100755 t/External_Overdrive.t > >diff --git a/t/External/OverDrive.t b/t/External/OverDrive.t >new file mode 100755 >index 0000000..b6134fa >--- /dev/null >+++ b/t/External/OverDrive.t >@@ -0,0 +1,55 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 BibLibre >+# >+# 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 C4::Context; >+use t::lib::Mocks qw(mock_preference); >+use Test::More tests => 6; >+ >+BEGIN { >+ use_ok('C4::External::OverDrive'); >+} >+ >+can_ok( >+ 'C4::External::OverDrive', qw( >+ _request >+ IsOverDriveEnabled >+ GetOverDriveToken ) >+); >+ >+# ---------- Testing IsOverDriveEnabled --------- >+ >+t::lib::Mocks::mock_preference( "OverDriveClientKey", 0 ); >+t::lib::Mocks::mock_preference( "OverDriveClientSecret", 0 ); >+ >+is( IsOverDriveEnabled(), 0, 'IsOverDriveEnabled fail' ); >+ >+t::lib::Mocks::mock_preference( "OverDriveClientKey", 0 ); >+t::lib::Mocks::mock_preference( "OverDriveClientSecret", 1 ); >+ >+is( IsOverDriveEnabled(), 0, 'IsOverDriveEnabled fail' ); >+ >+t::lib::Mocks::mock_preference( "OverDriveClientKey", 1 ); >+t::lib::Mocks::mock_preference( "OverDriveClientSecret", 0 ); >+ >+is( IsOverDriveEnabled(), 0, 'IsOverDriveEnabled fail' ); >+ >+t::lib::Mocks::mock_preference( "OverDriveClientKey", 1 ); >+t::lib::Mocks::mock_preference( "OverDriveClientSecret", 1 ); >+ >+is( IsOverDriveEnabled(), 1, 'IsOverDriveEnabled success' ); >diff --git a/t/External_Overdrive.t b/t/External_Overdrive.t >deleted file mode 100755 >index a659846..0000000 >--- a/t/External_Overdrive.t >+++ /dev/null >@@ -1,13 +0,0 @@ >-#!/usr/bin/perl >-# >-# This Koha test module is a stub! >-# Add more tests here!!! >- >-use strict; >-use warnings; >- >-use Test::More tests => 1; >- >-BEGIN { >- use_ok('C4::External::OverDrive'); >-} >-- >1.7.9.5
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 14147
:
38843
|
38847
|
38949
|
38991