diff --git a/composer.json b/composer.json index 15a213472..98d83a2a0 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,11 @@ "Twig_" : "lib/" } }, + "autoload-dev": { + "psr-0" : { + "Twig_Tests_" : "test/" + } + }, "extra": { "branch-alias": { "dev-master": "2.0-dev" diff --git a/test/Twig/Tests/Cache/FilesystemTest.php b/test/Twig/Tests/Cache/FilesystemTest.php index 541328dd6..52bba2d08 100644 --- a/test/Twig/Tests/Cache/FilesystemTest.php +++ b/test/Twig/Tests/Cache/FilesystemTest.php @@ -9,8 +9,6 @@ * file that was distributed with this source code. */ -require_once dirname(dirname(__FILE__)).'/FilesystemHelper.php'; - class Twig_Tests_Cache_FilesystemTest extends PHPUnit_Framework_TestCase { private $classname; diff --git a/test/Twig/Tests/EnvironmentTest.php b/test/Twig/Tests/EnvironmentTest.php index 05eeedac3..fbe2cceb6 100644 --- a/test/Twig/Tests/EnvironmentTest.php +++ b/test/Twig/Tests/EnvironmentTest.php @@ -9,8 +9,6 @@ * file that was distributed with this source code. */ -require_once dirname(__FILE__).'/FilesystemHelper.php'; - class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase { public function testAutoescapeOption() diff --git a/test/Twig/Tests/FilesystemHelper.php b/test/Twig/Tests/FilesystemHelper.php index 0e315e8f7..d9c782f4f 100644 --- a/test/Twig/Tests/FilesystemHelper.php +++ b/test/Twig/Tests/FilesystemHelper.php @@ -13,12 +13,8 @@ class Twig_Tests_FilesystemHelper { public static function removeDir($dir) { - $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, PHP_VERSION_ID < 50300 ? 0 : FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST); + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST); foreach ($iterator as $filename => $fileInfo) { - if ($iterator->isDot()) { - continue; - } - if ($fileInfo->isDir()) { rmdir($filename); } else {