summaryrefslogtreecommitdiff
path: root/core/tests/File_Structure_Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/tests/File_Structure_Test.php')
-rw-r--r--core/tests/File_Structure_Test.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/tests/File_Structure_Test.php b/core/tests/File_Structure_Test.php
index 23d6acbb..c4f8bc01 100644
--- a/core/tests/File_Structure_Test.php
+++ b/core/tests/File_Structure_Test.php
@@ -22,10 +22,11 @@ class File_Structure_Test extends Unit_Test_Case {
public function no_trailing_closing_php_tag_test() {
$dir = new GalleryCodeFilterIterator(
new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT)));
+ $incorrect = array();
foreach ($dir as $file) {
- if (preg_match('/(\?\>\s*)$/', file_get_contents($file), $matches)) {
- $this->assert_true(false, "$file ends in a trailing ?>");
- }
+ $this->assert_false(
+ preg_match('/\?\>\s*$/', file_get_contents($file)),
+ "{$file->getPathname()} ends in ?>");
}
}
@@ -34,12 +35,12 @@ class File_Structure_Test extends Unit_Test_Case {
new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT)));
foreach ($dir as $file) {
if ($file->getFilename() == 'kohana_unit_test.php') {
- // Exception, this file must be named accordingly for the test framework
+ // Exception: this file must be named accordingly for the test framework
continue;
}
- if (preg_match("|/views\b|", $file->getPath())) {
- $this->assert_equal(".html.php", substr($file->getPathname(), -9), $file->getPathname());
- }
+ $this->assert_false(
+ preg_match("|/views/.*?(?<!\.html)\.php|", $file->getPathname()),
+ "{$file->getPathname()} should end in .html.php");
}
}
}