Bugzilla – Attachment 110797 Details for
Bug 26524
Add Koha::Acquisition::Basket->orders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26524: Unit tests
Bug-26524-Unit-tests.patch (text/plain), 1.71 KB, created by
Katrin Fischer
on 2020-09-26 19:33:08 UTC
(
hide
)
Description:
Bug 26524: Unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-09-26 19:33:08 UTC
Size:
1.71 KB
patch
obsolete
>From 5079f95bca0f1fb1d6f8b0f3a3cccb36c4b98315 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 23 Sep 2020 15:56:32 -0300 >Subject: [PATCH] Bug 26524: Unit tests > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Acquisition/Basket.t | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t >index dc2232de2d..abe3d12a9f 100755 >--- a/t/db_dependent/Koha/Acquisition/Basket.t >+++ b/t/db_dependent/Koha/Acquisition/Basket.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 9; >+use Test::More tests => 10; > use t::lib::TestBuilder; > use t::lib::Mocks; > >@@ -271,3 +271,32 @@ subtest 'authorizer' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'orders' => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $basket = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets' >+ } >+ ); >+ >+ my $orders = $basket->orders; >+ is( ref($orders), 'Koha::Acquisition::Orders', 'Type is correct with no attached orders' ); >+ is( $orders->count, 0, 'No orders attached, count 0' ); >+ >+ my @actual_orders; >+ >+ for ( 1..10 ) { >+ push @actual_orders, $builder->build_object({ class => 'Koha::Acquisition::Orders', value => { basketno => $basket->id } }); >+ } >+ >+ $orders = $basket->orders; >+ is( ref($orders), 'Koha::Acquisition::Orders', 'Type is correct with no attached orders' ); >+ is( $orders->count, 10, '10 orders attached, count 10' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.11.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 26524
:
110616
|
110617
|
110622
|
110623
| 110797 |
110798
|
110914