Bug 7276 : Follow up, adding a sub to clear the cache
[koha.git] / t / 00-valid-xml.t
1 # Copyright 2010 Galen Charlton
2 #
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along
15 # with Koha; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 use strict;
19 use warnings;
20
21 use Test::More;
22 use File::Spec;
23 use File::Find;
24 use XML::LibXML;
25
26 my $parser = XML::LibXML->new();
27
28 find({
29     bydepth => 1,
30     no_chdir => 1,
31     wanted => sub {
32         my $file = $_;
33         return unless $file =~ /(\.xml|\.xsl|\.xslt)$/i;
34         my $dom;
35         eval { $dom = $parser->parse_file($file); };
36         if ($@) {
37             fail("$file parses");
38             diag($@);
39         } else {
40             pass("$file parses");
41         }
42     },
43 }, File::Spec->curdir());
44 done_testing();