Bugzilla – Attachment 174187 Details for
Bug 38011
Add a foreign key link between vendors and subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38011: (QA follow-up) Additional unit tests
Bug-38011-QA-follow-up-Additional-unit-tests.patch (text/plain), 2.31 KB, created by
Jonathan Druart
on 2024-11-07 12:41:59 UTC
(
hide
)
Description:
Bug 38011: (QA follow-up) Additional unit tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-07 12:41:59 UTC
Size:
2.31 KB
patch
obsolete
>From 2aee448d4669657f816c2c2e9b4e2e3d5409d02b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 7 Nov 2024 11:51:24 +0000 >Subject: [PATCH] Bug 38011: (QA follow-up) Additional unit tests > >Add an additional unit test for the default null on the new constraint. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Subscription.t | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/Subscription.t b/t/db_dependent/Koha/Subscription.t >index 6765640d381..e32f871bf5c 100755 >--- a/t/db_dependent/Koha/Subscription.t >+++ b/t/db_dependent/Koha/Subscription.t >@@ -80,17 +80,26 @@ subtest 'Notifications on new issues - add_subscriber|remove_subscriber|subscrib > }; > > subtest 'Koha::Subscription->vendor' => sub { >- plan tests => 2; >- my $vendor = $builder->build( { source => 'Aqbookseller' } ); >- my $subscription = $builder->build( >+ plan tests => 3; >+ my $vendor = $builder->build_object( { class => 'Koha::Acquisition::Booksellers' } ); >+ my $subscription = $builder->build_object( > { >- source => 'Subscription', >- value => { aqbooksellerid => $vendor->{id} } >+ class => 'Koha::Subscriptions', >+ value => { aqbooksellerid => $vendor->id } > } > ); >- my $object = Koha::Subscriptions->find( $subscription->{subscriptionid} ); >- is( ref($object->vendor), 'Koha::Acquisition::Bookseller', 'Koha::Subscription->vendor should return a Koha::Acquisition::Bookseller' ); >- is( $object->vendor->id, $subscription->{aqbooksellerid}, 'Koha::Subscription->vendor should return the correct vendor' ); >+ is( >+ ref( $subscription->vendor ), 'Koha::Acquisition::Bookseller', >+ 'Koha::Subscription->vendor should return a Koha::Acquisition::Bookseller' >+ ); >+ is( >+ $subscription->vendor->id, $subscription->aqbooksellerid, >+ 'Koha::Subscription->vendor should return the correct vendor' >+ ); >+ >+ $vendor->delete(); >+ $subscription->discard_changes; >+ is( $subscription->vendor, undef, 'Koha::Subscription->vendor should return undef if the vendor is deleted' ); > }; > > subtest 'Koha::Subscription->frequency' => sub { >-- >2.34.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 38011
:
171971
|
171972
|
173859
|
173860
|
174180
|
174181
|
174182
|
174183
|
174185
|
174186
| 174187 |
174188
|
174397
|
174492