Bugzilla – Attachment 153535 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), 2.76 KB, created by
Pedro Amorim
on 2023-07-17 09:54:26 UTC
(
hide
)
Description:
Bug 33871: Test where parameter in Sitemapper.t
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-07-17 09:54:26 UTC
Size:
2.76 KB
patch
obsolete
>From 703d7ac45bd286397477629fc92eb2854aa365ec 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> >--- > t/db_dependent/Sitemapper.t | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/Sitemapper.t b/t/db_dependent/Sitemapper.t >index f62c71fbe1..d835b39dea 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,10 +124,10 @@ 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 ) { >+ for my $count ( 0..9 ) { > my $biblio2 = $builder->build_sample_biblio->set({ datecreated => '2015-08-31', timestamp => '2015-08-31' })->store; > } > >@@ -142,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.30.2
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