diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-01-11 05:28:48 +0000 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-01-11 05:28:48 +0000 |
commit | 6510fae66114ec4f050e31990aab557762ef7ad7 (patch) | |
tree | 8f72a575361f75558d4fddbeb11a169f172d7176 /core/tests | |
parent | 5e0d0f546a6cdfe5828cc8ccdacec6608b7b9ae7 (diff) |
Remove path normalization, the current normalization code didn't go far enough anyway.
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/File_Structure_Test.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/tests/File_Structure_Test.php b/core/tests/File_Structure_Test.php index c1160b57..d1ebec81 100644 --- a/core/tests/File_Structure_Test.php +++ b/core/tests/File_Structure_Test.php @@ -37,8 +37,7 @@ class File_Structure_Test extends Unit_Test_Case { foreach ($dir as $file) { if (strpos($file, "views")) { $this->assert_true( - preg_match("#/views/.*?(\.html|mrss|txt)\.php$#", - strtr($file->getPathname(), DIRECTORY_SEPARATOR, '/')), + preg_match("#/views/.*?(\.html|mrss|txt)\.php$#", $file->getPathname()), "{$file->getPathname()} should end in .{html,mrss,txt}.php"); } } @@ -62,7 +61,7 @@ class File_Structure_Test extends Unit_Test_Case { $expected = $this->_get_preamble(__FILE__); foreach ($dir as $file) { - if (preg_match("/views/", strtr($file->getPathname(), DIRECTORY_SEPARATOR, '/'))) { + if (preg_match("/views/", $file->getPathname())) { // The preamble for views is a single line that prevents direct script access $lines = file($file->getPathname()); $this->assert_equal( @@ -71,8 +70,8 @@ class File_Structure_Test extends Unit_Test_Case { "in file: {$file->getPathname()}"); } else if (preg_match("|\.php$|", $file->getPathname())) { $actual = $this->_get_preamble($file->getPathname()); - if (strtr($file->getPathName(), DIRECTORY_SEPARATOR, '/') == DOCROOT . "index.php" || - strtr($file->getPathName(), DIRECTORY_SEPARATOR, '/') == DOCROOT . "installer/install.php") { + if ($file->getPathName() == DOCROOT . "index.php" || + $file->getPathName() == DOCROOT . "installer/install.php") { // index.php and installer.php allow direct access, so modify our expectations for them $index_expected = $expected; $index_expected[0] = "<?php"; @@ -116,7 +115,6 @@ class GalleryCodeFilterIterator extends FilterIterator { public function accept() { // Skip anything that we didn"t write $path_name = $this->getInnerIterator()->getPathName(); - $path_name = strtr($path_name, DIRECTORY_SEPARATOR, "/"); return !( strpos($path_name, ".svn") || strpos($path_name, "core/views/kohana_profiler.php") !== false || |