summaryrefslogtreecommitdiff
path: root/t/maint/php-tag.t
diff options
context:
space:
mode:
Diffstat (limited to 't/maint/php-tag.t')
-rw-r--r--t/maint/php-tag.t29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/maint/php-tag.t b/t/maint/php-tag.t
new file mode 100644
index 00000000..80b870b7
--- /dev/null
+++ b/t/maint/php-tag.t
@@ -0,0 +1,29 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Test::More;;
+
+use File::Find;
+use File::Slurp qw< slurp >;
+
+my $ext = qr/(?: php | inc )/x;
+
+my @files;
+find( sub { push @files, $File::Find::name if -f && /\. $ext $/x }, '.' );
+
+plan tests => scalar @files;
+
+for my $file (@files) {
+ my $cont = slurp $file;
+ if ( $cont =~ m<<\?php .* \?>>xs ) {
+ ok 1 => "$file has <?php ?>";
+ } elsif ( $cont =~ m<<\? .* \?>>xs ) {
+ ok 0 => "$file does not use <? ?>";
+ } else {
+ ok 1 => "$file has neither <?php ?> nor <? ?>, check it";
+ }
+}
+
+
+