From ec052d71301acbf519947897f8adda7fdcf7fefb Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:36:56 -0700 Subject: Assert how many files we analyze so that we can tell if we're suddenly analzying too many or too few. --- modules/gallery/tests/File_Structure_Test.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 1c3356d9..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() { -- cgit v1.2.3