summaryrefslogtreecommitdiffstats
path: root/t/004template.t
diff options
context:
space:
mode:
Diffstat (limited to 't/004template.t')
-rw-r--r--t/004template.t62
1 files changed, 41 insertions, 21 deletions
diff --git a/t/004template.t b/t/004template.t
index 909f1a231..666ce5fa4 100644
--- a/t/004template.t
+++ b/t/004template.t
@@ -1,19 +1,35 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code are the Bugzilla tests.
+#
+# The Initial Developer of the Original Code is Jacob Steenhagen.
+# Portions created by Jacob Steenhagen are
+# Copyright (C) 2001 Jacob Steenhagen. All
+# Rights Reserved.
+#
+# Contributor(s): Jacob Steenhagen <jake@bugzilla.org>
+# Zach Lipton <zach@zachlipton.com>
+# David D. Kilzer <ddkilzer@kilzer.net>
+# Tobias Burnus <burnus@net-b.de>
#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
#################
#Bugzilla Test 4#
####Templates####
-use 5.10.1;
use strict;
-use warnings;
-use lib qw(. lib local/lib/perl5 t);
+use lib 't';
use Support::Templates;
@@ -28,7 +44,7 @@ use Test::More tests => ( scalar(@referenced_files) + 2 * $num_actual_files );
# This will handle verbosity for us automatically.
my $fh;
{
- no warnings qw(unopened); # Don't complain about non-existent filehandles
+ local $^W = 0; # Don't complain about non-existent filehandles
if (-e \*Test::More::TESTOUT) {
$fh = \*Test::More::TESTOUT;
} elsif (-e \*Test::Builder::TESTOUT) {
@@ -39,21 +55,22 @@ my $fh;
}
# Check to make sure all templates that are referenced in Bugzilla
-# exist in the proper place in the English template or extension directory.
+# exist in the proper place in the English template directory.
# All other languages may or may not include any template as Bugzilla will
# fall back to English if necessary.
foreach my $file (@referenced_files) {
- my $found = 0;
- foreach my $path (@english_default_include_paths) {
- my $pathfile = File::Spec->catfile($path, $file);
- if (-e $pathfile) {
- $found = 1;
- last;
- }
+ my @path = map(File::Spec->catfile($_, $file), @include_paths);
+ push(@path, File::Spec->catfile($english_default_include_path, $file));
+ my $found;
+ foreach my $path (@path) {
+ $found = $path if -e $path;
+ }
+ if ($found) {
+ ok(1, "$file exists");
+ } else {
+ ok(0, "$file cannot be located --ERROR");
}
-
- ok($found, "$file found");
}
foreach my $include_path (@include_paths) {
@@ -66,13 +83,17 @@ foreach my $include_path (@include_paths) {
# See Template.pm for the actual codebase definitions.
# Initialize templates (f.e. by loading plugins like Hook).
- PRE_PROCESS => "global/variables.none.tmpl",
+ PRE_PROCESS => "global/initialize.none.tmpl",
FILTERS =>
{
html_linebreak => sub { return $_; },
+ no_break => sub { return $_; } ,
js => sub { return $_ } ,
base64 => sub { return $_ } ,
+ inactive => [ sub { return sub { return $_; } }, 1] ,
+ closed => [ sub { return sub { return $_; } }, 1] ,
+ obsolete => [ sub { return sub { return $_; } }, 1] ,
url_quote => sub { return $_ } ,
css_class_quote => sub { return $_ } ,
xml => sub { return $_ } ,
@@ -84,7 +105,6 @@ foreach my $include_path (@include_paths) {
wrap_comment => sub { return $_ },
none => sub { return $_ } ,
ics => [ sub { return sub { return $_; } }, 1] ,
- markdown => sub { return $_ } ,
},
}
);