当前位置: 首页>>代码示例>>PHP>>正文


PHP PHP_CodeCoverage_Filter::isFile方法代码示例

本文整理汇总了PHP中PHP_CodeCoverage_Filter::isFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_CodeCoverage_Filter::isFile方法的具体用法?PHP PHP_CodeCoverage_Filter::isFile怎么用?PHP PHP_CodeCoverage_Filter::isFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHP_CodeCoverage_Filter的用法示例。


在下文中一共展示了PHP_CodeCoverage_Filter::isFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: applySelfFilter

 /**
  * Filters sourcecode files from PHP_CodeCoverage, PHP_TokenStream,
  * Text_Template, and File_Iterator.
  *
  * @param array $data
  */
 protected function applySelfFilter(&$data)
 {
     foreach (array_keys($data) as $filename) {
         if (!$this->filter->isFile($filename)) {
             unset($data[$filename]);
             continue;
         }
         if (!$this->isCodeCoverageTestSuite && strpos($filename, dirname(__FILE__)) === 0) {
             unset($data[$filename]);
             continue;
         }
         if (!$this->isFileIteratorTestSuite && (substr($filename, -17) == 'File/Iterator.php' || substr($filename, -25) == 'File/Iterator/Factory.php')) {
             unset($data[$filename]);
             continue;
         }
         if (!$this->isTimerTestSuite && substr($filename, -13) == 'PHP/Timer.php') {
             unset($data[$filename]);
             continue;
         }
         if (!$this->isTokenStreamTestSuite && (substr($filename, -13) == 'PHP/Token.php' || substr($filename, -20) == 'PHP/Token/Stream.php' || substr($filename, -35) == 'PHP/Token/Stream/CachingFactory.php')) {
             unset($data[$filename]);
             continue;
         }
         if (substr($filename, -17) == 'Text/Template.php') {
             unset($data[$filename]);
         }
     }
 }
开发者ID:reflectivedevelopment,项目名称:jfh-lib,代码行数:34,代码来源:CodeCoverage.php

示例2: applySelfFilter

 /**
  * Filters sourcecode files from PHP_CodeCoverage, PHP_TokenStream,
  * Text_Template, and File_Iterator.
  *
  * @param array $data
  */
 protected function applySelfFilter(&$data)
 {
     foreach (array_keys($data) as $filename) {
         if (!$this->filter->isFile($filename)) {
             unset($data[$filename]);
             continue;
         }
         if (!defined('PHP_CODECOVERAGE_TESTSUITE') && strpos($filename, dirname(__FILE__)) === 0) {
             unset($data[$filename]);
             continue;
         }
         if (!defined('FILE_ITERATOR_TESTSUITE') && (substr($filename, -17) == 'File/Iterator.php' || substr($filename, -25) == 'File/Iterator/Factory.php')) {
             unset($data[$filename]);
             continue;
         }
         if (!defined('PHP_TIMER_TESTSUITE') && substr($filename, -13) == 'PHP/Timer.php') {
             unset($data[$filename]);
             continue;
         }
         if (!defined('PHP_TOKENSTREAM_TESTSUITE') && (substr($filename, -13) == 'PHP/Token.php' || substr($filename, -20) == 'PHP/Token/Stream.php' || substr($filename, -35) == 'PHP/Token/Stream/CachingFactory.php')) {
             unset($data[$filename]);
             continue;
         }
         if (substr($filename, -17) == 'Text/Template.php') {
             unset($data[$filename]);
         }
     }
 }
开发者ID:rdohms,项目名称:php-code-coverage,代码行数:34,代码来源:CodeCoverage.php

示例3: initializeFilesThatAreSeenTheFirstTime

 /**
  * @param array $data
  * @since Method available since Release 1.1.0
  */
 private function initializeFilesThatAreSeenTheFirstTime(array $data)
 {
     foreach ($data as $file => $lines) {
         if ($this->filter->isFile($file) && !isset($this->data[$file])) {
             $this->data[$file] = array();
             foreach ($lines as $k => $v) {
                 $this->data[$file][$k] = $v == -2 ? null : array();
             }
         }
     }
 }
开发者ID:Ingothq,项目名称:multiarmedbandit,代码行数:15,代码来源:CodeCoverage.php

示例4: getcwd

require_once 'File/Iterator/Autoload.php';
require_once 'PHP/CodeCoverage/Autoload.php';
// Set this to the directory that contains the code coverage files.
// It defaults to getcwd(). If you have configured a different directory
// in prepend.php, you need to configure the same directory here.
$GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = getcwd();
if (isset($_GET['PHPUNIT_SELENIUM_TEST_ID'])) {
    $facade = new File_Iterator_Facade();
    $files = $facade->getFilesAsArray($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], $_GET['PHPUNIT_SELENIUM_TEST_ID']);
    $coverage = array();
    foreach ($files as $file) {
        $data = unserialize(file_get_contents($file));
        unlink($file);
        unset($file);
        $filter = new PHP_CodeCoverage_Filter();
        foreach ($data as $file => $lines) {
            if ($filter->isFile($file)) {
                if (!isset($coverage[$file])) {
                    $coverage[$file] = array('md5' => md5_file($file), 'coverage' => $lines);
                } else {
                    foreach ($lines as $line => $flag) {
                        if (!isset($coverage[$file]['coverage'][$line]) || $flag > $coverage[$file]['coverage'][$line]) {
                            $coverage[$file]['coverage'][$line] = $flag;
                        }
                    }
                }
            }
        }
    }
    print serialize($coverage);
}
开发者ID:DaveNascimento,项目名称:civicrm-packages,代码行数:31,代码来源:phpunit_coverage.php

示例5: getcwd

 */
require_once 'File/Iterator/Factory.php';
require_once 'PHP/CodeCoverage/Filter.php';
// Set this to the directory that contains the code coverage files.
// It defaults to getcwd(). If you have configured a different directory
// in prepend.php, you need to configure the same directory here.
$GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = getcwd();
if (isset($_GET['PHPUNIT_SELENIUM_TEST_ID'])) {
    $files = File_Iterator_Factory::getFileIterator($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], $_GET['PHPUNIT_SELENIUM_TEST_ID']);
    $coverage = array();
    foreach ($files as $file) {
        $filename = $file->getPathName();
        $data = unserialize(file_get_contents($filename));
        @unlink($filename);
        unset($filename);
        foreach ($data as $filename => $lines) {
            if (PHP_CodeCoverage_Filter::isFile($filename)) {
                if (!isset($coverage[$filename])) {
                    $coverage[$filename] = array('md5' => md5_file($filename), 'coverage' => $lines);
                } else {
                    foreach ($lines as $line => $flag) {
                        if (!isset($coverage[$filename]['coverage'][$line]) || $flag > $coverage[$filename]['coverage'][$line]) {
                            $coverage[$filename]['coverage'][$line] = $flag;
                        }
                    }
                }
            }
        }
    }
    print serialize($coverage);
}
开发者ID:arjenschol,项目名称:phpunit,代码行数:31,代码来源:phpunit_coverage.php

示例6: aggregateCoverageInformation

 /**
  * Aggregates previously collected coverage information.
  *
  * @return string
  */
 public function aggregateCoverageInformation()
 {
     if (!isset($_GET[self::TEST_ID_VARIABLE])) {
         return '';
     }
     $coverage = array();
     $filter = new \PHP_CodeCoverage_Filter();
     foreach ($this->getDataDirectoryFiles() as $data_directory_file) {
         $raw_coverage_data = unserialize(file_get_contents($data_directory_file));
         foreach ($raw_coverage_data as $file => $lines) {
             if (!$filter->isFile($file)) {
                 continue;
             }
             if (!isset($coverage[$file])) {
                 $coverage[$file] = array('md5' => md5_file($file), 'coverage' => $lines);
             } else {
                 foreach ($lines as $line => $flag) {
                     if (!isset($coverage[$file]['coverage'][$line]) || $flag > $coverage[$file]['coverage'][$line]) {
                         $coverage[$file]['coverage'][$line] = $flag;
                     }
                 }
             }
         }
     }
     return serialize($coverage);
 }
开发者ID:mablae,项目名称:phpunit-mink,代码行数:31,代码来源:RemoteCoverageTool.php

示例7: array

    $factory = new File_Iterator_Factory();
    $files = $factory->getFileIterator($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], $_GET['PHPUNIT_SELENIUM_TEST_ID']);
    $filter = new PHP_CodeCoverage_Filter();
    $used = array();
    $coverage = array();
    foreach ($files as $file) {
        $filename = $file->getPathName();
        if (isset($used[$filename])) {
            //strange bug
            continue;
        }
        $data = unserialize(file_get_contents($filename));
        @unlink($filename);
        $used[$filename] = true;
        unset($filename);
        foreach ($data as $filename => $lines) {
            if ($filter->isFile($filename)) {
                if (!isset($coverage[$filename])) {
                    $coverage[$filename] = array('md5' => md5_file($filename), 'coverage' => $lines);
                } else {
                    foreach ($lines as $line => $flag) {
                        if (!isset($coverage[$filename]['coverage'][$line]) || $flag > $coverage[$filename]['coverage'][$line]) {
                            $coverage[$filename]['coverage'][$line] = $flag;
                        }
                    }
                }
            }
        }
    }
    print serialize($coverage);
}
开发者ID:visor,项目名称:nano,代码行数:31,代码来源:coverage.php


注:本文中的PHP_CodeCoverage_Filter::isFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。