Bugzilla – Attachment 46274 Details for
Bug 15337
Koha Item Type sorted by Codes instead of Descriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15337: Add tests to ensure that GetItemTypes will return element ordered by desc
Bug-15337-Add-tests-to-ensure-that-GetItemTypes-wi.patch (text/plain), 1.91 KB, created by
Marc Véron
on 2016-01-05 17:06:36 UTC
(
hide
)
Description:
Bug 15337: Add tests to ensure that GetItemTypes will return element ordered by desc
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-01-05 17:06:36 UTC
Size:
1.91 KB
patch
obsolete
>From db8a8de3502f53ebe18af91912921733b14daf8b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 5 Jan 2016 14:23:24 +0000 >Subject: [PATCH] Bug 15337: Add tests to ensure that GetItemTypes will return > element ordered by desc >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >See comment #3 >Signed-off-by: Marc Véron <veron@veron.ch> >--- > t/db_dependent/Koha.t | 26 +++++++++++--------------- > 1 file changed, 11 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t >index 7fdd419..c013434 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 => 9; >+use Test::More tests => 10; > use DateTime::Format::MySQL; > > BEGIN { >@@ -147,20 +147,6 @@ subtest 'Itemtype info Tests' => sub { > like ( getitemtypeinfo('BK', 'opac')->{'imageurl'}, qr/opac-tmpl/, 'getitemtypeinfo on "opac" interface returns opac imageurl' ); > }; > >- >- >- >- >- >- >- >- >- >- >- >- >- >- > ### test for C4::Koha->GetDailyQuote() > SKIP: > { >@@ -353,4 +339,14 @@ subtest 'GetItemTypesByCategory GetItemTypesCategorized test' => sub{ > @expected = ( 'BKghjklo1', 'Qwertyware', 'Veryheavybook' ); > is_deeply(\@results,\@expected, 'GetItemTypesCategorized: grouped and ungrouped items returned as expected.'); > }; >+ >+subtest 'GetItemTypes test' => sub { >+ plan tests => 1; >+ $dbh->do(q|DELETE FROM itemtypes|); >+ $dbh->do(q|INSERT INTO itemtypes(itemtype, description) VALUES ('a', 'aa desc'), ('b', 'zz desc'), ('d', 'dd desc'), ('c', 'yy desc')|); >+ my $itemtypes = C4::Koha::GetItemTypes( style => 'array' ); >+ $itemtypes = [ map { $_->{itemtype} } @$itemtypes ]; >+ is_deeply( $itemtypes, [ 'a', 'd', 'c', 'b' ], 'GetItemTypes(array) should return itemtypes ordered by description'); >+}; >+ > $dbh->rollback(); >-- >1.7.10.4
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 15337
:
46257
|
46258
|
46274
|
46275
|
46497
|
46498