mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-03-06 22:25:48 -05:00
Assert how many files we analyze so that we can tell if we're suddenly
analzying too many or too few.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user