diff options
author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-07-08 00:29:37 +0000 |
---|---|---|
committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-07-08 00:29:37 +0000 |
commit | c83650d83ad8b1f4bda30cac2ae8efa6e1c97287 (patch) | |
tree | 482cf980e87cd7c80c28a89bb9395eba6b53026f /modules/gallery/tests/File_Structure_Test.php | |
parent | a0b0b415515bff5f9edd43d373e8e78f3b3f8e4d (diff) | |
parent | 9d66783f47636153bf3661d1d89e694dd5188c36 (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/tests/File_Structure_Test.php')
-rw-r--r-- | modules/gallery/tests/File_Structure_Test.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 39df9f06..96e0b758 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -23,13 +23,18 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { public function no_trailing_closing_php_tag_test() { $dir = new GalleryCodeFilterIterator( new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); + $count = 0; foreach ($dir as $file) { + $count++; if (!preg_match("|\.html\.php$|", $file->getPathname())) { $this->assert_false( preg_match('/\?\>\s*$/', file_get_contents($file)), "{$file->getPathname()} ends in ?>"); } } + + $this->assert_true($count > 500, "We should have analyzed at least this 500 files"); + $this->assert_true($count < 1000, "We shouldn't be shipping 1000 files!"); } public function view_files_correct_suffix_test() { @@ -42,8 +47,8 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { if (strpos($file, "views")) { $this->assert_true( - preg_match("#/views/.*?(\.html|mrss|txt)\.php$#", $file->getPathname()), - "{$file->getPathname()} should end in .{html,mrss,txt}.php"); + preg_match("#/views/.*?\.(html|mrss|txt|json)\.php$#", $file->getPathname()), + "{$file->getPathname()} should end in .{html,mrss,txt,json}.php"); } } } |