Skip to content

Commit

Permalink
Merge branch '3.2/develop' into 3.3/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zombor committed Oct 23, 2012
2 parents e81c672 + b6b2ad8 commit 18bb452
Showing 1 changed file with 6 additions and 40 deletions.
46 changes: 6 additions & 40 deletions classes/Kohana/Unittest/Tests.php
Expand Up @@ -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 <type> $class
Expand Down Expand Up @@ -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;

}
Expand Down Expand Up @@ -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);
}
}
}
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 18bb452

Please sign in to comment.