Bugzilla – Attachment 101409 Details for
Bug 24464
Add K::A::Basket->creator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24464: Unit tests
Bug-24464-Unit-tests.patch (text/plain), 1.80 KB, created by
Jonathan Druart
on 2020-03-23 09:55:39 UTC
(
hide
)
Description:
Bug 24464: Unit tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-23 09:55:39 UTC
Size:
1.80 KB
patch
obsolete
>From 58833e1ed5ca2609f3913f108c386137b18901c0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 20 Jan 2020 15:59:59 -0300 >Subject: [PATCH] Bug 24464: Unit tests > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Acquisition/Basket.t | 32 +++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t >index 2bcf481b88..dfa7b6fab3 100644 >--- 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 => 5; >+use Test::More tests => 6; > use t::lib::TestBuilder; > use t::lib::Mocks; > >@@ -109,6 +109,36 @@ subtest 'basket_group' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'creator() tests' => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $basket = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets', >+ value => { authorisedby => undef } >+ } >+ ); >+ >+ is( $basket->creator, undef, 'Undef is handled as expected' ); >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ $basket->authorisedby( $patron->borrowernumber )->store->discard_changes; >+ >+ my $creator = $basket->creator; >+ is( ref($creator), 'Koha::Patron', 'Return type is correct' ); >+ is( $creator->borrowernumber, $patron->borrowernumber, 'Returned object is the right one' ); >+ >+ # Delete the patron >+ $patron->delete; >+ >+ is( $basket->creator, undef, 'Undef is handled as expected' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'to_api() tests' => sub { > > plan tests => 6; >-- >2.20.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 24464
:
97631
|
97632
|
98272
|
98275
|
98276
|
101316
|
101317
| 101409 |
101410
|
101411