Bugzilla – Attachment 174182 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.24 KB, created by
Martin Renvoize (ashimema)
on 2024-11-07 12:10:25 UTC
(
hide
)
Description:
Bug 38011: (QA follow-up) Additional unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-11-07 12:10:25 UTC
Size:
2.24 KB
patch
obsolete
>From e94e48cc5769b1628e739eb72efedca1463c643b 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> >--- > 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.47.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 38011
:
171971
|
171972
|
173859
|
173860
|
174180
|
174181
|
174182
|
174183
|
174185
|
174186
|
174187
|
174188
|
174397
|
174492