View | Details | Raw Unified | Return to bug 16751
Collapse All | Expand All

(-)a/misc/cronjobs/sitemap.pl (-2 / +2 lines)
Lines 52-64 unless ($url) { Link Here
52
}
52
}
53
$url =~ s/\/*$//g;
53
$url =~ s/\/*$//g;
54
54
55
my $sitemaper = Koha::Sitemapper->new(
55
my $sitemapper = Koha::Sitemapper->new(
56
    verbose => $verbose,
56
    verbose => $verbose,
57
    url     => $url,
57
    url     => $url,
58
    dir     => $dir,
58
    dir     => $dir,
59
    short   => $short,
59
    short   => $short,
60
);
60
);
61
$sitemaper->run();
61
$sitemapper->run();
62
62
63
63
64
=head1 USAGE
64
=head1 USAGE
(-)a/t/db_dependent/Sitemapper.t (-7 / +6 lines)
Lines 73-85 my $data = [ Link Here
73
];
73
];
74
fixtures($data);
74
fixtures($data);
75
# Create a sitemap for a catalog containg 2 biblios, with option 'long url'
75
# Create a sitemap for a catalog containg 2 biblios, with option 'long url'
76
my $sitemaper = Koha::Sitemapper->new(
76
my $sitemapper = Koha::Sitemapper->new(
77
    verbose => 0,
77
    verbose => 0,
78
    url     => 'http://www.mylibrary.org',
78
    url     => 'http://www.mylibrary.org',
79
    dir     => $dir,
79
    dir     => $dir,
80
    short   => 0,
80
    short   => 0,
81
);
81
);
82
$sitemaper->run();
82
$sitemapper->run();
83
83
84
my $file = "$dir/sitemapindex.xml";
84
my $file = "$dir/sitemapindex.xml";
85
ok( -e "$dir/sitemapindex.xml", "File sitemapindex.xml created");
85
ok( -e "$dir/sitemapindex.xml", "File sitemapindex.xml created");
Lines 120-132 is( $file_content, $expected_content, "Its content is valid" ); Link Here
120
120
121
# Create a sitemap for a catalog containg 2 biblios, with option 'short url'.
121
# Create a sitemap for a catalog containg 2 biblios, with option 'short url'.
122
# Test that 2 files are created.
122
# Test that 2 files are created.
123
$sitemaper = Koha::Sitemapper->new(
123
$sitemapper = Koha::Sitemapper->new(
124
    verbose => 0,
124
    verbose => 0,
125
    url     => 'http://www.mylibrary.org',
125
    url     => 'http://www.mylibrary.org',
126
    dir     => $dir,
126
    dir     => $dir,
127
    short   => 1,
127
    short   => 1,
128
);
128
);
129
$sitemaper->run();
129
$sitemapper->run();
130
130
131
$file = "$dir/sitemap0001.xml";
131
$file = "$dir/sitemap0001.xml";
132
ok( -e $file, "File sitemap0001.xml with short URLs created");
132
ok( -e $file, "File sitemap0001.xml with short URLs created");
Lines 154-166 is( $file_content, $expected_content, "Its content is valid" ); Link Here
154
$data = [];
154
$data = [];
155
push @$data, [ $_, '2015-08-31', '2015-08-31'] for 3..75000;
155
push @$data, [ $_, '2015-08-31', '2015-08-31'] for 3..75000;
156
fixtures($data);
156
fixtures($data);
157
$sitemaper = Koha::Sitemapper->new(
157
$sitemapper = Koha::Sitemapper->new(
158
    verbose => 0,
158
    verbose => 0,
159
    url     => 'http://www.mylibrary.org',
159
    url     => 'http://www.mylibrary.org',
160
    dir     => $dir,
160
    dir     => $dir,
161
    short   => 1,
161
    short   => 1,
162
);
162
);
163
$sitemaper->run();
163
$sitemapper->run();
164
164
165
$file = "$dir/sitemapindex.xml";
165
$file = "$dir/sitemapindex.xml";
166
ok( -e "$dir/sitemapindex.xml", "File sitemapindex.xml for 75000 bibs created");
166
ok( -e "$dir/sitemapindex.xml", "File sitemapindex.xml for 75000 bibs created");
167
- 

Return to bug 16751