From b6b2ad845cc876a20a11a250872d9f6982c46a9f Mon Sep 17 00:00:00 2001 From: Jeremy Bush Date: Mon, 22 Oct 2012 20:03:33 -0500 Subject: [PATCH] Remove compatibility checking from tests class, we only support 3.7 now. Refs #4623 --- classes/kohana/unittest/tests.php | 46 ++++--------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/classes/kohana/unittest/tests.php b/classes/kohana/unittest/tests.php index ce607d6..308cd4a 100644 --- a/classes/kohana/unittest/tests.php +++ b/classes/kohana/unittest/tests.php @@ -13,13 +13,6 @@ class Kohana_Unittest_Tests { static protected $cache = array(); - /** - * Flag to identify whether the installed version of phpunit - * is greater than or equal to 3.5 - * @var boolean - */ - static protected $phpunit_v35 = FALSE; - /** * Loads test files if they cannot be found by kohana * @param $class @@ -50,9 +43,6 @@ static public function configure_environment($do_whitelist = TRUE, $do_blacklist spl_autoload_register(array('Unittest_tests', 'autoload')); - // As of PHPUnit v3.5 there are slight differences in the way files are black|whitelisted - self::$phpunit_v35 = function_exists('phpunit_autoload'); - Unittest_tests::$cache = (($cache = Kohana::cache('unittest_whitelist_cache')) === NULL) ? array() : $cache; } @@ -130,14 +120,7 @@ static function addTests(Unittest_TestSuite $suite, array $files) require_once($file); } - if (self::$phpunit_v35) - { - $suite->addFileToBlacklist($file); - } - else - { - PHPUnit_Util_Filter::addFileToFilter($file); - } + $suite->addFileToBlacklist($file); } } } @@ -151,32 +134,15 @@ static function addTests(Unittest_TestSuite $suite, array $files) */ static public function blacklist(array $blacklist_items, Unittest_TestSuite $suite = NULL) { - if (self::$phpunit_v35) + foreach ($blacklist_items as $item) { - foreach ($blacklist_items as $item) + if (is_dir($item)) { - if (is_dir($item)) - { - $suite->addDirectoryToBlacklist($item); - } - else - { - $suite->addFileToBlacklist($item); - } + $suite->addDirectoryToBlacklist($item); } - } - else - { - foreach ($blacklist_items as $item) + else { - if (is_dir($item)) - { - PHPUnit_Util_Filter::addDirectoryToFilter($item); - } - else - { - PHPUnit_Util_Filter::addFileToFilter($item); - } + $suite->addFileToBlacklist($item); } } }