Bugzilla – Attachment 113547 Details for
Bug 26984
Tests are failing if AnonymousPatron is configured
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26984: Don't delete data in Koha/Item.t tests
Bug-26984-Dont-delete-data-in-KohaItemt-tests.patch (text/plain), 4.11 KB, created by
Jonathan Druart
on 2020-11-12 11:23:29 UTC
(
hide
)
Description:
Bug 26984: Don't delete data in Koha/Item.t tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-11-12 11:23:29 UTC
Size:
4.11 KB
patch
obsolete
>From 54f049a786ff82fdd6ebfac4748609e43454e6d0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 12 Nov 2020 12:22:43 +0100 >Subject: [PATCH] Bug 26984: Don't delete data in Koha/Item.t tests > >I don't really understand why I had to lower the number of tests >--- > t/db_dependent/Koha/Item.t | 30 ++++++++++++++++-------------- > 1 file changed, 16 insertions(+), 14 deletions(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 0309fa94f6..950be7eeea 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -156,18 +156,13 @@ subtest "as_marc_field() tests" => sub { > }; > > subtest 'pickup_locations' => sub { >- plan tests => 114; >+ plan tests => 60; > > $schema->storage->txn_begin; > > my $dbh = C4::Context->dbh; > >- # Cleanup database >- Koha::Holds->search->delete; >- $dbh->do('DELETE FROM issues'); >- Koha::Patrons->search->delete; >- Koha::Items->search->delete; >- Koha::Libraries->search->delete; >+ my $nb_libraries = Koha::Libraries->count; > Koha::CirculationRules->search->delete; > Koha::CirculationRules->set_rules( > { >@@ -192,6 +187,11 @@ subtest 'pickup_locations' => sub { > my $group2_1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library3->branchcode } } ); > my $group2_2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library4->branchcode } } ); > >+ our @branchcodes = ( >+ $library1->branchcode, $library2->branchcode, >+ $library3->branchcode, $library4->branchcode >+ ); >+ > my $item1 = $builder->build_sample_item( > { > homebranch => $library1->branchcode, >@@ -214,17 +214,17 @@ subtest 'pickup_locations' => sub { > my $patron4 = $builder->build_object( { class => 'Koha::Patrons', value => { branchcode => $library4->branchcode, firstname => '4' } } ); > > my $results = { >- "1-1-1-any" => 3, >+ "1-1-1-any" => 3 + $nb_libraries, > "1-1-1-holdgroup" => 2, > "1-1-1-patrongroup" => 2, > "1-1-1-homebranch" => 1, > "1-1-1-holdingbranch" => 1, >- "1-1-2-any" => 3, >+ "1-1-2-any" => 3 + $nb_libraries, > "1-1-2-holdgroup" => 2, > "1-1-2-patrongroup" => 2, > "1-1-2-homebranch" => 1, > "1-1-2-holdingbranch" => 1, >- "1-1-3-any" => 3, >+ "1-1-3-any" => 3 + $nb_libraries, > "1-1-3-holdgroup" => 2, > "1-1-3-patrongroup" => 2, > "1-1-3-homebranch" => 1, >@@ -234,7 +234,7 @@ subtest 'pickup_locations' => sub { > "1-4-1-patrongroup" => 0, > "1-4-1-homebranch" => 0, > "1-4-1-holdingbranch" => 0, >- "1-4-2-any" => 3, >+ "1-4-2-any" => 3 + $nb_libraries, > "1-4-2-holdgroup" => 2, > "1-4-2-patrongroup" => 1, > "1-4-2-homebranch" => 1, >@@ -249,7 +249,7 @@ subtest 'pickup_locations' => sub { > "3-1-1-patrongroup" => 0, > "3-1-1-homebranch" => 0, > "3-1-1-holdingbranch" => 0, >- "3-1-2-any" => 3, >+ "3-1-2-any" => 3 + $nb_libraries, > "3-1-2-holdgroup" => 1, > "3-1-2-patrongroup" => 2, > "3-1-2-homebranch" => 0, >@@ -264,12 +264,12 @@ subtest 'pickup_locations' => sub { > "3-4-1-patrongroup" => 0, > "3-4-1-homebranch" => 0, > "3-4-1-holdingbranch" => 0, >- "3-4-2-any" => 3, >+ "3-4-2-any" => 3 + $nb_libraries, > "3-4-2-holdgroup" => 1, > "3-4-2-patrongroup" => 1, > "3-4-2-homebranch" => 0, > "3-4-2-holdingbranch" => 1, >- "3-4-3-any" => 3, >+ "3-4-3-any" => 3 + $nb_libraries, > "3-4-3-holdgroup" => 1, > "3-4-3-patrongroup" => 1, > "3-4-3-homebranch" => 0, >@@ -294,6 +294,8 @@ subtest 'pickup_locations' => sub { > my $ha_value=$ha==3?'holdgroup':($ha==2?'any':'homebranch'); > > foreach my $pickup_location (@pl) { >+ next >+ unless grep { $pickup_location eq $_ } @branchcodes; > is( ref($pickup_location), 'Koha::Library', 'Object type is correct' ); > } > ok( >-- >2.20.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 26984
:
113547
|
113550
|
113551
|
113552
|
113662
|
113704
|
113817
|
113818