Bugzilla – Attachment 70274 Details for
Bug 19915
Inventory tool doesn't use cn_sort for callnumber ranges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19915 - Unit test
Bug-19915---Unit-test.patch (text/plain), 2.25 KB, created by
Nick Clemens
on 2018-01-04 15:05:50 UTC
(
hide
)
Description:
Bug 19915 - Unit test
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2018-01-04 15:05:50 UTC
Size:
2.25 KB
patch
obsolete
>From 7d7ccd6aca904f4cce3a5969030a7cda9bd45faf Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 4 Jan 2018 14:53:14 +0000 >Subject: [PATCH] Bug 19915 - Unit test > >prove -v t/db_dependent/Items/GetItemsForInventory.t >--- > t/db_dependent/Items/GetItemsForInventory.t | 42 ++++++++++++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items/GetItemsForInventory.t b/t/db_dependent/Items/GetItemsForInventory.t >index 452b15e..9dd2095 100755 >--- a/t/db_dependent/Items/GetItemsForInventory.t >+++ b/t/db_dependent/Items/GetItemsForInventory.t >@@ -18,9 +18,11 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 6; >+use Test::More tests => 7; >+use t::lib::TestBuilder; > > use Koha::AuthorisedValues; >+use C4::ClassSource; > > $| = 1; > >@@ -43,6 +45,44 @@ my ($newResults, $newCount) = GetItemsForInventory; > is_deeply($newResults,$oldResults,"Inventory results unchanged."); > > $dbh->rollback; >+$dbh->{AutoCommit} = 1; >+ >+subtest 'Use cn_sort rather than callnumber to determine correct location' => sub { >+ >+ plan tests => 1; >+ my $builder = t::lib::TestBuilder->new; >+ my $schema = Koha::Database->new->schema; >+ $schema->storage->txn_begin; >+ $builder->schema->resultset( 'Issue' )->delete_all; >+ $builder->schema->resultset( 'Item' )->delete_all; >+ >+ my $class_rule = $builder->build({ >+ source => 'ClassSortRule', >+ value => { sort_routine => "LCC" } >+ }); >+ my $class_source = $builder->build({ >+ source => 'ClassSource', >+ value => { >+ class_sort_rule => $class_rule->{class_sort_rule}, >+ } >+ }); >+ my $item_1 = $builder->build({ >+ source => 'Item', >+ value => { >+ itemcallnumber => 'GT95', >+ cn_sort => GetClassSort($class_source->{cn_source},undef,'GT95'), >+ } >+ }); >+ >+ my( undef, $item_count) = GetItemsForInventory({ >+ maxlocation => 'GT100', >+ minlocation => 'GT90', >+ class_source => $class_source->{cn_source}, >+ }); >+ is($item_count,1,"We should return GT95 as betwen GT90 and GT100"); >+ $schema->storage->txn_rollback; >+ >+}; > > sub OldWay { > my ($tdbh) = @_; >-- >2.1.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 19915
:
70274
|
70275
|
70338
|
70339
|
72950
|
72951
|
72988
|
72989
|
76120
|
76721
|
76722
|
76723
|
76724
|
81816
|
81817
|
81818
|
81819
|
81820
|
81821
|
83644
|
83645
|
83646
|
83647
|
83648
|
83649
|
84665
|
84666
|
84667
|
84668
|
84669
|
84670