Bugzilla – Attachment 181911 Details for
Bug 39832
Add $basket->vendor() method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39832: Unit tests
Bug-39832-Unit-tests.patch (text/plain), 1.43 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-05-05 12:15:56 UTC
(
hide
)
Description:
Bug 39832: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-05-05 12:15:56 UTC
Size:
1.43 KB
patch
obsolete
>From 816d946cf21a17fa0d2627ac509e2f42d632b8a0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 5 May 2025 09:14:35 -0300 >Subject: [PATCH] Bug 39832: Unit tests > >--- > t/db_dependent/Koha/Acquisition/Basket.t | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Acquisition/Basket.t b/t/db_dependent/Koha/Acquisition/Basket.t >index 71a392be9d3..4e3ed58ddbb 100755 >--- a/t/db_dependent/Koha/Acquisition/Basket.t >+++ b/t/db_dependent/Koha/Acquisition/Basket.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 14; >+use Test::More tests => 15; > use Test::Exception; > > use t::lib::TestBuilder; >@@ -445,3 +445,22 @@ subtest 'close() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'vendor() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $basket = $builder->build_object( { class => 'Koha::Acquisition::Baskets' } ); >+ my $vendor = $basket->vendor; >+ is( ref($vendor), 'Koha::Acquisition::Bookseller', 'Right object type' ); >+ my $other_vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); >+ >+ # change the vendor >+ $basket->set( { booksellerid => $other_vendor->id } )->store()->discard_changes(); >+ >+ is( $basket->vendor->id, $other_vendor->id, 'Method returns the new vendor' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.49.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 39832
:
181911
|
181912
|
181949
|
181950
|
182060
|
182061
|
182088
|
182089