From a7f22994ed0298ed051235e90bb581703956ba30 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 1 Nov 2008 18:45:25 +0000 Subject: Add a new test to verify that view files end in .html.php --- core/tests/File_Structure_Test.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'core/tests/File_Structure_Test.php') diff --git a/core/tests/File_Structure_Test.php b/core/tests/File_Structure_Test.php index d0749062..23d6acbb 100644 --- a/core/tests/File_Structure_Test.php +++ b/core/tests/File_Structure_Test.php @@ -28,6 +28,20 @@ class File_Structure_Test extends Unit_Test_Case { } } } + + public function view_files_end_in_html_dot_php_test() { + $dir = new GalleryCodeFilterIterator( + new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); + foreach ($dir as $file) { + if ($file->getFilename() == 'kohana_unit_test.php') { + // Exception, this file must be named accordingly for the test framework + continue; + } + if (preg_match("|/views\b|", $file->getPath())) { + $this->assert_equal(".html.php", substr($file->getPathname(), -9), $file->getPathname()); + } + } + } } class GalleryCodeFilterIterator extends FilterIterator { -- cgit v1.2.3