Bugzilla – Attachment 178138 Details for
Bug 39145
Differentiate between deleting or transferring public and shared lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39145: Add unit tests
Bug-39145-Add-unit-tests.patch (text/plain), 2.71 KB, created by
Marcel de Rooy
on 2025-02-17 12:21:28 UTC
(
hide
)
Description:
Bug 39145: Add unit tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-02-17 12:21:28 UTC
Size:
2.71 KB
patch
obsolete
>From 981a24795180e307448b241137d85fc59ddc2bb1 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 17 Feb 2025 10:56:18 +0000 >Subject: [PATCH] Bug 39145: Add unit tests >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/Koha/Virtualshelves.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Virtualshelves.t | 43 +++++++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Virtualshelves.t b/t/db_dependent/Koha/Virtualshelves.t >index 36c1bda5c7..09a9d297ac 100755 >--- a/t/db_dependent/Koha/Virtualshelves.t >+++ b/t/db_dependent/Koha/Virtualshelves.t >@@ -30,7 +30,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'disown_or_delete() tests' => sub { > >- plan tests => 3; >+ plan tests => 4; > > subtest 'All set cases' => sub { > >@@ -171,6 +171,47 @@ subtest 'disown_or_delete() tests' => sub { > $schema->storage->txn_rollback; > }; > >+ subtest 'ListOwnershipUponPatronDeletion set to transfer_public' => sub { >+ plan tests => 2; >+ $schema->storage->txn_begin; >+ my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_3 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $public_list = $builder->build_object( >+ { >+ class => "Koha::Virtualshelves", >+ value => { owner => $patron_1->id, public => 1 } >+ } >+ ); >+ my $private_list_shared = $builder->build_object( >+ { >+ class => "Koha::Virtualshelves", >+ value => { owner => $patron_1->id, public => 0 } >+ } >+ ); >+ $builder->build_object( >+ { >+ class => 'Koha::Virtualshelfshares', >+ value => >+ { shelfnumber => $private_list_shared->id, invitekey => undef, borrowernumber => $patron_2->id } >+ } >+ ); >+ >+ t::lib::Mocks::mock_preference( 'ListOwnershipUponPatronDeletion', 'transfer_public' ); >+ t::lib::Mocks::mock_preference( 'ListOwnerDesignated', $patron_3->id ); >+ >+ my $rs = Koha::Virtualshelves->search( >+ { shelfnumber => [ $public_list->id, $private_list_shared->id ] } ); >+ >+ my $result = $rs->disown_or_delete; >+ $rs->reset; >+ >+ is( $rs->count, 1, 'Only public list should be transferred' ); >+ is( $rs->next->id, $public_list->id, 'Check id too' ); >+ >+ $schema->storage->txn_rollback; >+ }; >+ > subtest 'ListOwnershipUponPatronDeletion set to delete' => sub { > > plan tests => 2; >-- >2.39.5
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 39145
:
178136
|
178137
|
178138
|
182851
|
182870
|
182871
|
182872
|
182873