Bugzilla – Attachment 155108 Details for
Bug 33871
Add where parameter to sitemap.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33871: Test where parameter in Sitemapper.t
Bug-33871-Test-where-parameter-in-Sitemappert.patch (text/plain), 3.03 KB, created by
Jonathan Druart
on 2023-09-01 12:10:41 UTC
(
hide
)
Description:
Bug 33871: Test where parameter in Sitemapper.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-09-01 12:10:41 UTC
Size:
3.03 KB
patch
obsolete
>From 09dddbe1f80009a061c3c55d73b56cdf7736aa22 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 31 May 2023 12:55:04 +0000 >Subject: [PATCH] Bug 33871: Test where parameter in Sitemapper.t > >This makes it possible to remove the ugly global deletes at the >start. > >Test plan: >Run t/db_dependent/Sitemapper.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Sitemapper.t | 20 +++++++------------- > 1 file changed, 7 insertions(+), 13 deletions(-) > >diff --git a/t/db_dependent/Sitemapper.t b/t/db_dependent/Sitemapper.t >index 6e4ffd6389f..3faaa168c20 100755 >--- a/t/db_dependent/Sitemapper.t >+++ b/t/db_dependent/Sitemapper.t >@@ -30,8 +30,6 @@ use t::lib::Mocks; > > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); >-use Koha::Biblios; >-use Koha::Checkouts; > use Koha::Sitemapper; > use Koha::Sitemapper::Writer; > >@@ -44,9 +42,6 @@ subtest 'Sitemapper' => sub { > > my $now = dt_from_string()->ymd; > >- # FIXME Would be nice to remove both deletes again >- Koha::Checkouts->delete; >- Koha::Biblios->delete; > my $biblio1 = $builder->build_sample_biblio; > $biblio1->set( { datecreated => '2013-11-15', timestamp => '2013-11-15' } )->store; > my $id1 = $biblio1->id; >@@ -63,7 +58,7 @@ subtest 'Sitemapper' => sub { > dir => $dir, > short => 0, > ); >- $sitemapper->run(); >+ $sitemapper->run( "biblionumber>=$id1" ); > > my $file = "$dir/sitemapindex.xml"; > ok( -e "$dir/sitemapindex.xml", 'File sitemapindex.xml created' ); >@@ -108,7 +103,7 @@ EOS > dir => $dir, > short => 1, > ); >- $sitemapper->run(); >+ $sitemapper->run( "biblionumber>=$id1" ); > > $file = "$dir/sitemap0001.xml"; > ok( -e $file, 'File sitemap0001.xml with short URLs created' ); >@@ -129,12 +124,11 @@ EOS > EOS > is( $file_content, $expected_content, 'Its content is valid' ); > >- # No need to create 75000 biblios here. Let's create 10 with $MAX == 6. >- # Expecting 3 files: index plus 2 url files with 6 and 4 urls. >+ # No need to create 75000 biblios here. Let's create 10 more with $MAX == 6. >+ # Expecting 3 files: index plus 2 url files with 6 and 4 urls (when we start after biblio2). > $Koha::Sitemapper::Writer::MAX = 6; >- for my $count ( 3 .. 10 ) { >- my $biblio2 = >- $builder->build_sample_biblio->set( { datecreated => '2015-08-31', timestamp => '2015-08-31' } )->store; >+ for my $count ( 0..9 ) { >+ my $biblio2 = $builder->build_sample_biblio->set({ datecreated => '2015-08-31', timestamp => '2015-08-31' })->store; > } > > $sitemapper = Koha::Sitemapper->new( >@@ -143,7 +137,7 @@ EOS > dir => $dir, > short => 1, > ); >- $sitemapper->run(); >+ $sitemapper->run( "biblionumber>$id2" ); # Note: new filter > > $file = "$dir/sitemapindex.xml"; > ok( -e "$dir/sitemapindex.xml", 'File sitemapindex.xml for 10 bibs created' ); >-- >2.25.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 33871
:
151879
|
151880
|
153458
|
153534
|
153535
|
155107
| 155108