Bugzilla – Attachment 30505 Details for
Bug 12675
Remove CGI::scrolling_list from labeledMARCdetail.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12675: Add unit test to GetFrameworksLoop
SIGNED-OFF-Bug-12675-Add-unit-test-to-GetFramework.patch (text/plain), 2.66 KB, created by
Bernardo Gonzalez Kriegel
on 2014-08-02 23:32:18 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12675: Add unit test to GetFrameworksLoop
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-08-02 23:32:18 UTC
Size:
2.66 KB
patch
obsolete
>From 4d2e0eb5709020460a76bf89fcb73de22ca76b0c Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Wed, 30 Jul 2014 11:31:39 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 12675: Add unit test to GetFrameworksLoop > >to test: >1. Apply the patch >2. Run the test, prove t/db_dependent/Koha.t >3. Check that it pass > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > t/db_dependent/Koha.t | 48 +++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 47 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t >index 0e90403..dae1ebc 100644 >--- a/t/db_dependent/Koha.t >+++ b/t/db_dependent/Koha.t >@@ -8,7 +8,7 @@ use warnings; > use C4::Context; > use Koha::DateUtils qw(dt_from_string); > >-use Test::More tests => 7; >+use Test::More tests => 8; > use DateTime::Format::MySQL; > > BEGIN { >@@ -261,3 +261,49 @@ subtest 'getFacets() tests' => sub { > 'location facet present with singleBranchMode on (bug 10078)' > ); > }; >+ >+subtest 'GetFrameworksLoop() tests' => sub { >+ plan tests => 6; >+ >+ $dbh->do("DELETE FROM biblio_framework"); >+ >+ my $frameworksloop = GetFrameworksLoop(); >+ is ( scalar(@$frameworksloop), 0, 'No frameworks' ); >+ >+ $dbh->do("INSERT INTO biblio_framework ( frameworkcode, frameworktext ) VALUES ( 'A', 'Third framework' )"); >+ $dbh->do("INSERT INTO biblio_framework ( frameworkcode, frameworktext ) VALUES ( 'B', 'Second framework' )"); >+ $dbh->do("INSERT INTO biblio_framework ( frameworkcode, frameworktext ) VALUES ( 'C', 'First framework' )"); >+ >+ $frameworksloop = GetFrameworksLoop(); >+ is ( scalar(@$frameworksloop), 3, 'All frameworks' ); >+ is ( scalar ( grep { defined $_->{'selected'} } @$frameworksloop ), 0, 'None selected' ); >+ >+ $frameworksloop = GetFrameworksLoop( 'B' ); >+ is ( scalar ( grep { defined $_->{'selected'} } @$frameworksloop ), 1, 'One selected' ); >+ my @descriptions = map { $_->{'description'} } @$frameworksloop; >+ is ( $descriptions[0], 'First framework', 'Ordered result' ); >+ cmp_deeply( >+ $frameworksloop, >+ [ >+ { >+ 'value' => 'C', >+ 'description' => 'First framework', >+ 'selected' => undef, >+ }, >+ { >+ 'value' => 'B', >+ 'description' => 'Second framework', >+ 'selected' => 1, # selected >+ }, >+ { >+ 'value' => 'A', >+ 'description' => 'Third framework', >+ 'selected' => undef, >+ } >+ ], >+ 'Full check, sorted by description with selected val (Bug 12675)' >+ ); >+}; >+ >+$dbh->rollback(); >+ >-- >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 12675
:
30306
|
30408
|
30409
|
30413
|
30436
|
30437
|
30505
|
30507
|
30508