Bugzilla – Attachment 97586 Details for
Bug 24457
K::A::Basket->to_api is not passing the parameters to the parent class implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24457: Regression tests
Bug-24457-Regression-tests.patch (text/plain), 2.05 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-19 05:08:47 UTC
(
hide
)
Description:
Bug 24457: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-19 05:08:47 UTC
Size:
2.05 KB
patch
obsolete
>From b6851200e5f7fee1fe517c4a6306ceb38ba9dd76 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sun, 19 Jan 2020 02:05:40 -0300 >Subject: [PATCH] Bug 24457: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Acquisition/Basket.t | 36 +++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t >index e262e2d1f2..2bcf481b88 100644 >--- a/t/db_dependent/Koha/Acquisition/Basket.t >+++ b/t/db_dependent/Koha/Acquisition/Basket.t >@@ -19,12 +19,13 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use t::lib::TestBuilder; > use t::lib::Mocks; > > use C4::Acquisition; > use Koha::Database; >+use Koha::DateUtils qw(dt_from_string); > > use_ok('Koha::Acquisition::Basket'); > use_ok('Koha::Acquisition::Baskets'); >@@ -107,3 +108,36 @@ subtest 'basket_group' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'to_api() tests' => sub { >+ >+ plan tests => 6; >+ >+ $schema->storage->txn_begin; >+ >+ my $vendor = $builder->build_object({ class => 'Koha::Acquisition::Booksellers' }); >+ my $basket = $builder->build_object( >+ { >+ class => 'Koha::Acquisition::Baskets', >+ value => { >+ closedate => undef >+ } >+ } >+ ); >+ >+ my $closed = $basket->to_api->{closed}; >+ ok( defined $closed, 'closed is defined' ); >+ ok( !$closed, 'closedate is undef, closed evaluates to false' ); >+ >+ $basket->closedate( dt_from_string )->store->discard_changes; >+ $closed = $basket->to_api->{closed}; >+ ok( defined $closed, 'closed is defined' ); >+ ok( $closed, 'closedate is defined, closed evaluates to true' ); >+ >+ $basket->booksellerid( $vendor->id )->store->discard_changes; >+ my $basket_json = $basket->to_api({ embed => { bookseller => {} } }); >+ ok( exists $basket_json->{bookseller} ); >+ is_deeply( $basket_json->{bookseller}, $vendor->to_api ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.25.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 24457
:
97586
|
97587
|
97588
|
97589
|
97672
|
97673