Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Assert how many files we analyze so that we can tell if we're suddenly

analzying too many or too few.
  • Loading branch information...
commit ec052d71301acbf519947897f8adda7fdcf7fefb 1 parent 9f9d386
@bharat bharat authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 modules/gallery/tests/File_Structure_Test.php
View
5 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() {
Please sign in to comment.
Something went wrong with that request. Please try again.