diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-01-24 18:14:28 -0500 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-01-24 18:14:28 -0500 |
commit | 03535786307c60f0f79ce4f773c9c1a8e43826ed (patch) | |
tree | 5ef1329cfaea5ab43dd9d28cb8aa48c0a34e1eed /modules/gallery/tests/File_Structure_Test.php | |
parent | 86a2759062ee3dbf93f4c17c7499e3f506035047 (diff) | |
parent | 98d09c3740f1c19e477a71bdb44791306d7bd05b (diff) |
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/tests/File_Structure_Test.php')
-rw-r--r-- | modules/gallery/tests/File_Structure_Test.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 7ad865e0..ce75ea13 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -285,7 +285,7 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { } public function all_public_functions_in_test_files_end_in_test() { - // Who tests the tests? :-) + // Who tests the tests? :-) (ref: http://www.xkcd.com/1163) $dir = new PhpCodeFilterIterator( new GalleryCodeFilterIterator( new RecursiveIteratorIterator( @@ -315,4 +315,20 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { } } } + + public function no_extra_spaces_at_end_of_line_test() { + $dir = new GalleryCodeFilterIterator( + new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); + $errors = ""; + foreach ($dir as $file) { + if (preg_match("/\.(php|css|html|js)$/", $file)) { + foreach (file($file) as $line_num => $line) { + if ((substr($line, -2) == " \n") || (substr($line, -1) == " ")) { + $errors .= "$file at line " . ($line_num + 1) . "\n"; + } + } + } + } + $this->assert_true(empty($errors), "Extra spaces at end of line found at:\n$errors"); + } } |