Fix for examples directory iterator in PHP 5.2. Future-proof things a bit by actually checking for file extension before accessing that index.
This commit is contained in:
@@ -262,9 +262,10 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
|
||||
foreach ($children as $file) {
|
||||
if (!$file->isFile()) continue;
|
||||
|
||||
$filename = $file->getPathInfo();
|
||||
$filename = $file->getPathname();
|
||||
$info = pathinfo($filename);
|
||||
|
||||
if (isset($info['extension'])) {
|
||||
switch($info['extension']) {
|
||||
case 'php':
|
||||
$class = $info['filename'];
|
||||
@@ -280,6 +281,7 @@ class MustacheTest extends PHPUnit_Framework_TestCase {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ret[$example] = array($class, $template, $output);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user