Bugzilla – Attachment 78252 Details for
Bug 18639
Separate replacement cost and retail price fields in acquisitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18639: Unit tests
Bug-18639-Unit-tests.patch (text/plain), 3.35 KB, created by
Katrin Fischer
on 2018-08-29 06:03:07 UTC
(
hide
)
Description:
Bug 18639: Unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-08-29 06:03:07 UTC
Size:
3.35 KB
patch
obsolete
>From eeaba026b7c237169d0d5393cd4b15e019bdac63 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 29 Dec 2017 16:22:08 +0000 >Subject: [PATCH] Bug 18639: Unit tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Acquisition.t | 45 +++++++++++++++++++++++++++++++++++- > 1 file changed, 44 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index 975fb034b2..04687eb7a7 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/t/db_dependent/Acquisition.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use POSIX qw(strftime); > >-use Test::More tests => 68; >+use Test::More tests => 70; > use t::lib::Mocks; > use Koha::Database; > >@@ -31,6 +31,7 @@ BEGIN { > use_ok('C4::Budgets'); > use_ok('Koha::Acquisition::Orders'); > use_ok('Koha::Acquisition::Booksellers'); >+ use_ok('t::lib::TestBuilder'); > } > > # Sub used for testing C4::Acquisition subs returning order(s): >@@ -665,4 +666,46 @@ sub create_isbn_field { > return $field; > } > >+subtest 'ModReceiveOrder replacementprice tests' => sub { >+ plan tests => 2; >+ #Let's build an order, we need a couple things though >+ my $builder = t::lib::TestBuilder->new; >+ my $order_biblio = $builder->build({ source => 'Biblio' }); >+ my $order_basket = $builder->build({ source => 'Aqbasket', value => { is_standing => 0 } }); >+ my $order_invoice = $builder->build({ source => 'Aqinvoice'}); >+ my $order_currency = $builder->build({ source => 'Currency', value => { active => 1, archived => 0, symbol => 'F', rate => 2, isocode => undef, currency => 'FOO' } }); >+ my $order_vendor = $builder->build({ source => 'Aqbookseller',value => { listincgst => 0, listprice => $order_currency->{currency}, invoiceprice => $order_currency->{currency} } }); >+ my $orderinfo ={ >+ basketno => $order_basket->{basketno}, >+ booksellerid => $order_vendor->{id}, >+ rrp => 19.99, >+ replacementprice => undef, >+ quantity => 1, >+ quantityreceived => 0, >+ datereceived => undef, >+ datecancellationprinted => undef, >+ }; >+ my $receive_order = $builder->build({ source => 'Aqorder', value => $orderinfo }); >+ (undef, my $received_ordernumber) = ModReceiveOrder({ >+ biblionumber => $order_biblio->{biblionumber}, >+ order => $receive_order, >+ invoice => $order_invoice, >+ quantityreceived => $receive_order->{quantity}, >+ budget_id => $order->{budget_id}, >+ }); >+ my $received_order = GetOrder($received_ordernumber); >+ is ($received_order->{replacementprice},undef,"No price set if none passed in"); >+ $orderinfo->{replacementprice} = 16.12; >+ $receive_order = $builder->build({ source => 'Aqorder', value => $orderinfo }); >+ (undef, $received_ordernumber) = ModReceiveOrder({ >+ biblionumber => $order_biblio->{biblionumber}, >+ order => $receive_order, >+ invoice => $order_invoice, >+ quantityreceived => $receive_order->{quantity}, >+ budget_id => $order->{budget_id}, >+ }); >+ $received_order = GetOrder($received_ordernumber); >+ is ($received_order->{replacementprice},'16.120000',"Replacement price set if none passed in"); >+}; >+ > $schema->storage->txn_rollback(); >-- >2.17.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 18639
:
70213
|
70214
|
70215
|
70216
|
75946
|
76867
|
76868
|
76869
|
76870
|
76871
|
78184
|
78185
|
78186
|
78187
|
78188
|
78189
|
78191
|
78249
|
78250
|
78251
| 78252 |
78253
|
78254
|
78255
|
78256
|
79789