Bugzilla – Attachment 39840 Details for
Bug 13967
Add package for System preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13967: Add a couple of tests for SysPref and Object
Bug-13967-Add-a-couple-of-tests-for-SysPref-and-Ob.patch (text/plain), 2.76 KB, created by
Jonathan Druart
on 2015-06-04 10:07:22 UTC
(
hide
)
Description:
Bug 13967: Add a couple of tests for SysPref and Object
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-06-04 10:07:22 UTC
Size:
2.76 KB
patch
obsolete
>From e514e304bf4c8caee2434f244e81a3f77c8a25dc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@koha-community.org> >Date: Thu, 4 Jun 2015 12:05:17 +0200 >Subject: [PATCH] Bug 13967: Add a couple of tests for SysPref and Object > >Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org> >--- > t/db_dependent/Borrowers.t | 5 ++++- > t/db_dependent/sysprefs.t | 10 ++++++---- > 2 files changed, 10 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Borrowers.t b/t/db_dependent/Borrowers.t >index bd75551..50d9c32 100755 >--- a/t/db_dependent/Borrowers.t >+++ b/t/db_dependent/Borrowers.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 13; > use Test::Warn; > > use C4::Context; >@@ -72,6 +72,9 @@ is( $b1->surname(), $b1_new->surname(), "Found matching borrower" ); > my @borrowers = Koha::Borrowers->search( { branchcode => $branchcode } ); > is( @borrowers, 3, "Found 3 borrowers with Search" ); > >+my $unexistent = Koha::Borrowers->find( '1234567890' ); >+is( $unexistent, undef, 'Koha::Objects->Find should return undef if the record does not exist' ); >+ > my $borrowers = Koha::Borrowers->search( { branchcode => $branchcode } ); > is( $borrowers->count( { branchcode => $branchcode } ), 3, "Counted 3 borrowers with Count" ); > >diff --git a/t/db_dependent/sysprefs.t b/t/db_dependent/sysprefs.t >index 5b82750..c678d24 100755 >--- a/t/db_dependent/sysprefs.t >+++ b/t/db_dependent/sysprefs.t >@@ -19,7 +19,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 4; >+use Test::More tests => 5; > use C4::Context; > > # Start transaction >@@ -31,10 +31,10 @@ my $opacheader = C4::Context->preference('opacheader'); > my $newopacheader = "newopacheader"; > > C4::Context->set_preference( 'OPACHEADER', $newopacheader ); >-is( C4::Context->preference('opacheader'), $newopacheader ); >+is( C4::Context->preference('opacheader'), $newopacheader, 'The pref should have been set correctly' ); > > C4::Context->set_preference( 'opacheader', $opacheader ); >-is( C4::Context->preference('OPACHEADER'), $opacheader ); >+is( C4::Context->preference('OPACHEADER'), $opacheader, 'A pref name should be case insensitive'); > > $ENV{OVERRIDE_SYSPREF_opacheader} = 'this is an override'; > C4::Context->clear_syspref_cache(); >@@ -44,5 +44,7 @@ is( > 'system preference value overridden from environment' > ); > >+is( C4::Context->preference('IDoNotExist'), undef, 'Get a non-existent system preference should return undef'); >+ > C4::Context->set_preference( 'IDoNotExist', 'NonExistent' ); >-is( C4::Context->preference('IDoNotExist'), 'NonExistent', 'Test creation of non-existant system preferencer' ); >+is( C4::Context->preference('IDoNotExist'), 'NonExistent', 'Test creation of non-existent system preference' ); >-- >2.1.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 13967
:
37572
|
37575
|
37576
|
37579
|
37581
|
37583
|
39839
| 39840