summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorzach%zachlipton.com <>2002-04-04 06:01:01 +0200
committerzach%zachlipton.com <>2002-04-04 06:01:01 +0200
commit09114c215c8c58595964ff017ab80394860fd75b (patch)
tree2e6931289bde6c6fc426dcbccbcc004970ef7984 /t
parent153a60fc43567d0b79aa6bf1d70e76be12521de1 (diff)
downloadbugzilla-09114c215c8c58595964ff017ab80394860fd75b.tar.gz
bugzilla-09114c215c8c58595964ff017ab80394860fd75b.tar.xz
Fix for bug 98658: Let administrator know which customised templates have been updated by Bugzilla team.
Patch adds a version string to every template and a check in t/004template.t to check for version strings in templates. Note that two templates that were not included in the initial patch now have version strings added. r=justdave, r2=myk
Diffstat (limited to 't')
-rw-r--r--t/004template.t20
1 files changed, 17 insertions, 3 deletions
diff --git a/t/004template.t b/t/004template.t
index 4c3c898c1..e831e42e4 100644
--- a/t/004template.t
+++ b/t/004template.t
@@ -18,15 +18,16 @@
# Rights Reserved.
#
# Contributor(s): Jacob Steenhagen <jake@acutex.net>
+# Zach Lipton <zach@zachlipton.com>
#
#################
#Bugzilla Test 4#
-##Templates######
+####Templates####
BEGIN { use lib "t/"; }
BEGIN { use Support::Templates; }
-BEGIN { $tests = @Support::Templates::testitems * 2; }
+BEGIN { $tests = @Support::Templates::testitems * 3; }
BEGIN { use Test::More tests => $tests; }
use strict;
@@ -80,10 +81,23 @@ foreach my $file(@testitems) {
}
}
else {
- ok(1, "$file doesn't exists, skipping test");
+ ok(1, "$file doesn't exist, skipping test");
}
}
open STDOUT, ">&SAVEOUT"; # redirect back to original stream
open STDERR, ">&SAVEERR";
close SAVEOUT;
close SAVEERR;
+
+# check to see that all templates have a version string:
+
+foreach my $file(@testitems) {
+ open(TMPL,"$include_path/$file");
+ my $firstline = <TMPL>;
+ if ($firstline =~ /<!-- \d+\.\d+\@[\w\._]+ -->/) {
+ ok(1,"$file has a version string");
+ } else {
+ ok(0,"$file does not have a version string --ERROR");
+ }
+ close(TMPL);
+}