Bugzilla – Attachment 114940 Details for
Bug 25670
Add useful methods to Koha::Acquisition::Orders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25670: Regression tests
Bug-25670-Regression-tests.patch (text/plain), 3.53 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-01-07 19:38:07 UTC
(
hide
)
Description:
Bug 25670: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-01-07 19:38:07 UTC
Size:
3.53 KB
patch
obsolete
>From 9a7fee65152f05bc0bbaa749510b6f75d8ae00b1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 7 Jan 2021 16:15:54 -0300 >Subject: [PATCH] Bug 25670: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Acquisition/Orders.t | 33 +++++++++++++++++++++--- > 1 file changed, 30 insertions(+), 3 deletions(-) > mode change 100644 => 100755 t/db_dependent/Koha/Acquisition/Orders.t > >diff --git a/t/db_dependent/Koha/Acquisition/Orders.t b/t/db_dependent/Koha/Acquisition/Orders.t >old mode 100644 >new mode 100755 >index 7cf6b30fd6..672ca1fa18 >--- a/t/db_dependent/Koha/Acquisition/Orders.t >+++ b/t/db_dependent/Koha/Acquisition/Orders.t >@@ -36,6 +36,20 @@ subtest 'filter_by_active() tests' => sub { > > $schema->storage->txn_begin; > >+ my $basket_1 = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets', >+ value => { is_standing => 1 } >+ } >+ ); >+ >+ my $basket_2 = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets', >+ value => { is_standing => 0 } >+ } >+ ); >+ > my $order_1 = $builder->build_object( > { > class => 'Koha::Acquisition::Orders', >@@ -51,7 +65,10 @@ subtest 'filter_by_active() tests' => sub { > my $order_3 = $builder->build_object( > { > class => 'Koha::Acquisition::Orders', >- value => { orderstatus => 'new' } >+ value => { >+ basketno => $basket_1->basketno, >+ orderstatus => 'new' >+ } > } > ); > my $order_4 = $builder->build_object( >@@ -66,6 +83,15 @@ subtest 'filter_by_active() tests' => sub { > value => { orderstatus => 'partial' } > } > ); >+ my $order_6 = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Orders', >+ value => { >+ basketno => $basket_2->basketno, >+ orderstatus => 'new' >+ } >+ } >+ ); > > my $this_orders_rs = Koha::Acquisition::Orders->search( > { >@@ -75,6 +101,7 @@ subtest 'filter_by_active() tests' => sub { > $order_3->ordernumber, > $order_4->ordernumber, > $order_5->ordernumber, >+ $order_6->ordernumber, > ] > }, > { >@@ -84,7 +111,7 @@ subtest 'filter_by_active() tests' => sub { > > my $rs = $this_orders_rs->filter_by_active; > >- is( $rs->count, 3, 'Only new, ordered and partial orders are returned' ); >+ is( $rs->count, 3, 'Only new (basket is standing), ordered and partial orders are returned' ); > is( $rs->next->ordernumber, $order_3->ordernumber , 'Expected order in resultset' ); > is( $rs->next->ordernumber, $order_4->ordernumber , 'Expected order in resultset' ); > is( $rs->next->ordernumber, $order_5->ordernumber , 'Expected order in resultset' ); >@@ -123,8 +150,8 @@ subtest 'filter_by_id_including_transfers() tests' => sub { > $orders_rs = $orders_rs->filter_by_id_including_transfers({ ordernumber => $order_1->ordernumber }); > > is( $orders_rs->count, 2, 'The two referenced orders are returned' ); >- is( $orders_rs->next->ordernumber, $order_2->ordernumber, 'The right order is returned' ); > is( $orders_rs->next->ordernumber, $order_1->ordernumber, 'The right order is returned' ); >+ is( $orders_rs->next->ordernumber, $order_2->ordernumber, 'The right order is returned' ); > > $orders_rs = $orders_rs->filter_by_id_including_transfers({ ordernumber => $order_2->ordernumber }); > >-- >2.30.0
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 25670
:
105534
|
105535
|
109859
|
109860
|
110643
|
110644
|
110700
|
110701
| 114940 |
114941
|
116141