You are here

private function PHPUnit_Util_Blacklist::initialize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/Blacklist.php \PHPUnit_Util_Blacklist::initialize()
2 calls to PHPUnit_Util_Blacklist::initialize()
PHPUnit_Util_Blacklist::getBlacklistedDirectories in vendor/phpunit/phpunit/src/Util/Blacklist.php
@since Method available since Release 4.1.0
PHPUnit_Util_Blacklist::isBlacklisted in vendor/phpunit/phpunit/src/Util/Blacklist.php

File

vendor/phpunit/phpunit/src/Util/Blacklist.php, line 83

Class

PHPUnit_Util_Blacklist
Utility class for blacklisting PHPUnit's own source code files.

Code

private function initialize() {
  if (self::$directories === null) {
    self::$directories = array();
    foreach (self::$blacklistedClassNames as $className => $parent) {
      if (!class_exists($className)) {
        continue;
      }
      $reflector = new ReflectionClass($className);
      $directory = $reflector
        ->getFileName();
      for ($i = 0; $i < $parent; $i++) {
        $directory = dirname($directory);
      }
      self::$directories[] = $directory;
    }

    // Hide process isolation workaround on Windows.
    // @see PHPUnit_Util_PHP::factory()
    // @see PHPUnit_Util_PHP_Windows::process()
    if (DIRECTORY_SEPARATOR === '\\') {

      // tempnam() prefix is limited to first 3 chars.
      // @see http://php.net/manual/en/function.tempnam.php
      self::$directories[] = sys_get_temp_dir() . '\\PHP';
    }
  }
}