Bugzilla – Attachment 56080 Details for
Bug 5620
Capture Mode of payment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug5620 - Add tests for sub GetKohaAuthorisedValues
Bug5620---Add-tests-for-sub-GetKohaAuthorisedValue.patch (text/plain), 2.47 KB, created by
Bouzid Fergani
on 2016-10-07 16:41:53 UTC
(
hide
)
Description:
Bug5620 - Add tests for sub GetKohaAuthorisedValues
Filename:
MIME Type:
Creator:
Bouzid Fergani
Created:
2016-10-07 16:41:53 UTC
Size:
2.47 KB
patch
obsolete
>From c63c0a11533b4a7687c5ad27d5507faa1fbe1b8a Mon Sep 17 00:00:00 2001 >From: Bouzid Fergani <bouzid.fergani@inlibro.com> >Date: Fri, 7 Oct 2016 12:38:35 -0400 >Subject: [PATCH] Bug5620 - Add tests for sub GetKohaAuthorisedValues > >--- > t/Koha.t | 31 +++++++++++++++++++++++++++++-- > 1 file changed, 29 insertions(+), 2 deletions(-) > >diff --git a/t/Koha.t b/t/Koha.t >index 21cbf68..1187c3b 100755 >--- a/t/Koha.t >+++ b/t/Koha.t >@@ -25,7 +25,7 @@ use Module::Load::Conditional qw/check_install/; > > BEGIN { > if ( check_install( module => 'Test::DBIx::Class' ) ) { >- plan tests => 31; >+ plan tests => 32; > } else { > plan skip_all => "Need Test::DBIx::Class" > } >@@ -138,4 +138,31 @@ subtest 'getFacets() tests' => sub { > ); > }; > >-1; >+subtest 'GetKohaAuthorisedValues() tests' => sub { >+ plan tests => 6; >+ my $values; >+ is( C4::Koha::GetKohaAuthorisedValues('','','',''), undef, 'Test GetKohaAuthorisedValues with empty parameters values'); >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES (?, ?, ?, ?)"); >+ my $sth1 = $dbh->prepare("INSERT INTO marc_subfield_structure VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); >+ >+ $sth->execute('TESTMODE','TestDebit','TestDebitstaff','TestDebitopac'); >+ $sth->execute('TESTMODE','TestCC','TestCCstaff','TestCCopac'); >+ $sth->execute('TESTFIELD','TestCC','TestCCstaff','TestCCopac'); >+ $sth1->execute(999,'z','Test','Test',0,0,'TestFieldKoha',10,'TESTMODE','','',0,0,'','','','',9999); >+ >+ $values = C4::Koha::GetKohaAuthorisedValues('TestFieldKoha'); >+ ok($values->{TestCC} eq 'TestCCstaff','GetKohaAuthorisedValues return the correct value when put kohafield parameter and empty for other parameters'); >+ >+ is (C4::Koha::GetKohaAuthorisedValues('TestFieldNotExist'), undef ,'GetKohaAuthorisedValues return undef when kohafield not exist'); >+ >+ $values = C4::Koha::GetKohaAuthorisedValues('','','','TESTMODE'); >+ ok(keys %$values eq 2,'GetKohaAuthorisedValues return the correct number of result'); >+ ok($values->{TestCC} eq 'TestCCstaff','GetKohaAuthorisedValues return a correct value when put category parameter and empty for other parameters'); >+ >+ $values = C4::Koha::GetKohaAuthorisedValues('','',1,'TESTMODE'); >+ ok($values->{TestDebit} eq 'TestDebitopac','GetKohaAuthorisedValues return a correct value when put category,opac parameter and empty for other parameters'); >+}; >+ >+-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 5620
:
2997
|
51290
|
56036
|
56037
|
56080
|
60994
|
60996
|
67361
|
67362
|
67394
|
67603
|
67634
|
67661
|
69002