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


PHP xdebug_stop_code_coverage函数代码示例

本文整理汇总了PHP中xdebug_stop_code_coverage函数的典型用法代码示例。如果您正苦于以下问题:PHP xdebug_stop_code_coverage函数的具体用法?PHP xdebug_stop_code_coverage怎么用?PHP xdebug_stop_code_coverage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: tearDown

 protected function tearDown()
 {
     xdebug_stop_code_coverage(false);
     $this->clearEntity($this->method);
     xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     parent::tearDown();
 }
开发者ID:kingsj,项目名称:core,代码行数:7,代码来源:PaymentAbstract.php

示例2: stop

 /**
  * Stop collection of code coverage information.
  *
  * @return array
  */
 public function stop()
 {
     // @codeCoverageIgnoreStart
     $codeCoverage = xdebug_get_code_coverage();
     xdebug_stop_code_coverage();
     return $codeCoverage;
     // @codeCoverageIgnoreEnd
 }
开发者ID:reflectivedevelopment,项目名称:jfh-lib,代码行数:13,代码来源:Xdebug.php

示例3: stopCodeCoverage

 public static function stopCodeCoverage()
 {
     if (function_exists('xdebug_stop_code_coverage') && self::$coverageStopped === false) {
         self::$coverageStopped = xdebug_stop_code_coverage(false);
         return self::$coverageStopped;
     }
     return;
 }
开发者ID:jaydiablo,项目名称:xdebug-test-case,代码行数:8,代码来源:TestHelper.php

示例4: pauseCodeCoverageAnalysis

 public static function pauseCodeCoverageAnalysis()
 {
     if (false === self::isCodeCoverageAnalysisRunning()) {
         return;
     }
     self::collectCodeCoverageReport();
     xdebug_stop_code_coverage(false);
     self::$m_isCodeCoverageAnalysisRunning = false;
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.test,代码行数:9,代码来源:xdebug.php

示例5: paintGroupEnd

 /**
  * Paints the end of a group test. Will paint the page
  * footer if the stack of tests has unwound.
  * @param string $test_name   Name of test that is ending.
  * @param integer $progress   Number of test cases ending.
  */
 function paintGroupEnd($test_name)
 {
     if (extension_loaded('xdebug')) {
         $this->code_coverage = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
         ksort($this->code_coverage);
     }
     HtmlReporter::paintGroupEnd($test_name);
 }
开发者ID:clickdimension,项目名称:tinybutstrong,代码行数:15,代码来源:HtmlCodeCoverageReporter.php

示例6: save_coverage_data

function save_coverage_data($test_id)
{
    $data = xdebug_get_code_coverage();
    xdebug_stop_code_coverage();
    if (!is_dir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'])) {
        mkdir($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777, true);
    }
    $file = $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] . '/' . $test_id . '.' . md5(uniqid(rand(), true));
    echo "Saving coverage data to {$file}...\n";
    file_put_contents($file, serialize($data));
}
开发者ID:shabesoglu,项目名称:pcbsd,代码行数:11,代码来源:echoserver.php

示例7: stopCodeCoverage

 public function stopCodeCoverage()
 {
     //echo "stopCodeCoverage called...\n";
     if (extension_loaded('xdebug')) {
         $data = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
         //echo "xdebug_stop_code_coverage called...\n";
         global $CDASH_COVERAGE_DIR;
         $file = $CDASH_COVERAGE_DIR . DIRECTORY_SEPARATOR . md5($_SERVER['SCRIPT_FILENAME']);
         file_put_contents($file . '.' . md5(uniqid(rand(), true)) . '.' . get_class(), serialize($data));
     }
 }
开发者ID:kitware,项目名称:cdash,代码行数:12,代码来源:kw_web_tester.php

示例8: stop

 /**
  * Stops code coverage.
  *
  * @return array The collected coverage
  */
 public function stop()
 {
     $data = xdebug_get_code_coverage();
     xdebug_stop_code_coverage($this->_config['cleanup']);
     $result = [];
     foreach ($data as $file => $coverage) {
         foreach ($coverage as $line => $value) {
             if ($line && $value !== -2) {
                 $result[$file][$line - 1] = $value === -1 ? 0 : $value;
             }
         }
     }
     return $result;
 }
开发者ID:crysalead,项目名称:kahlan,代码行数:19,代码来源:Xdebug.php

示例9: stop

 public static function stop($reportDir = null)
 {
     if ($reportDir !== null) {
         self::initialize($reportDir);
     }
     if (function_exists('xdebug_start_code_coverage')) {
         $userStory = self::getUserStoryFromFile();
         self::updateCodeCoverageReports($userStory);
         // some session handlers, close() for example, will be called after main script finished executing, so if we call CodeCoverage::stop()
         // and xdebug is stopped then it will be implossible to get code coverage stats for such session handlers.
         xdebug_stop_code_coverage(true);
     }
     self::generateHtmlReports($reportDir);
 }
开发者ID:vitalyspirin,项目名称:codecoverage,代码行数:14,代码来源:CodeCoverage.php

示例10: stop

 /**
  * Stop collection of code coverage information and store it in Sqlite3.
  *
  * @return array
  */
 public function stop()
 {
     $cov = xdebug_get_code_coverage();
     xdebug_stop_code_coverage();
     if (!isset($this->root)) {
         $this->root = getcwd();
     }
     $dataHandler = new DataHandler(self::SQLITE_DB);
     chdir($this->root);
     $dataHandler->write($cov);
     $cleanData = $this->cleanup($dataHandler->read());
     unset($dataHandler);
     // release sqlite connection
     return $cleanData;
 }
开发者ID:legovaer,项目名称:phpcov-runner,代码行数:20,代码来源:XdebugSQLite3.php

示例11: apply

 /**
  * Takes an instance of an object (usually a Collection object) containing test
  * instances. Attaches code coverage filtering to test cases.
  *
  * @see lithium\test\filter\Coverage::collect()
  * @param object $report Instance of Report which is calling apply.
  * @param array $tests The test to apply this filter on
  * @param array $options Options for how code coverage should be applied. These options are
  *              also passed to `Coverage::collect()` to determine how to aggregate results. See
  *              the documentation for `collect()` for further options.  Options affecting this
  *              method are:
  *              -'method': The name of method to attach to, defaults to 'run'.
  * @return object|void Returns the instance of `$tests` with code coverage analysis
  *                     triggers applied.
  */
 public static function apply($report, $tests, array $options = array())
 {
     $defaults = array('method' => 'run');
     $options += $defaults;
     $m = $options['method'];
     $filter = function ($self, $params, $chain) use($report, $options) {
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
         $chain->next($self, $params, $chain);
         $results = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
         $report->collect(__CLASS__, array($self->subject() => $results));
     };
     $tests->invoke('applyFilter', array($m, $filter));
     return $tests;
 }
开发者ID:EHER,项目名称:chegamos,代码行数:30,代码来源:Coverage.php

示例12: endDebug

function endDebug()
{
    if (defined('SH_DEBUG_VERIFY_FOLDER') && is_dir(SH_DEBUG_VERIFY_FOLDER)) {
        if (defined('SH_DEBUG_COVERAGE_PAGE')) {
            $linker = sh_linker::getInstance();
            if (file_exists(SH_DEBUG_COVERAGE_PAGE)) {
                include SH_DEBUG_COVERAGE_PAGE;
            } else {
                $coverage = array();
            }
            $all_elements = debug_get_coverage($coverage);
            $linker->helper->writeArrayInFile(SH_DEBUG_COVERAGE_PAGE, "coverage", $all_elements);
            xdebug_stop_code_coverage();
        }
    }
}
开发者ID:briceparent,项目名称:Shopsailors,代码行数:16,代码来源:debug_functions.php

示例13: apply

 /**
  * Takes an instance of an object (usually a Collection object) containing test
  * instances. Attaches code coverage filtering to test cases.
  *
  * @see lithium\test\filter\Coverage::collect()
  * @param object $report Instance of Report which is calling apply.
  * @param array $tests The test to apply this filter on
  * @param array $options Options for how code coverage should be applied. These options are
  *              also passed to `Coverage::collect()` to determine how to aggregate results. See
  *              the documentation for `collect()` for further options.  Options affecting this
  *              method are:
  *              -'method': The name of method to attach to, defaults to 'run'.
  * @return object Returns the instance of `$tests` with code coverage analysis
  *                     triggers applied.
  */
 public static function apply($report, $tests, array $options = array())
 {
     $defaults = array('method' => 'run');
     $options += $defaults;
     if (!function_exists('xdebug_start_code_coverage')) {
         $msg = "Xdebug not installed. Please install Xdebug before running code coverage.";
         throw new RuntimeException($msg);
     }
     $filter = function ($self, $params, $chain) use($report, $options) {
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
         $chain->next($self, $params, $chain);
         $results = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
         $report->collect(__CLASS__, array($self->subject() => $results));
     };
     $tests->invoke('applyFilter', array($options['method'], $filter));
     return $tests;
 }
开发者ID:newmight2015,项目名称:Blockchain-2,代码行数:33,代码来源:Coverage.php

示例14: paintFooter

 function paintFooter($test_name)
 {
     if (extension_loaded('xdebug')) {
         $this->coverage = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
     }
     $colour = $this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green";
     print "<div style=\"";
     print "padding: 8px; margin-top: 1em; background-color: {$colour}; color: white;";
     print "\">";
     print $this->getTestCaseProgress() . "/" . $this->getTestCaseCount();
     print " test cases complete:\n";
     print "<strong>" . $this->getPassCount() . "</strong> passes, ";
     print "<strong>" . $this->getFailCount() . "</strong> fails and ";
     print "<strong>" . $this->getExceptionCount() . "</strong> exceptions.";
     print "</div>\n";
     $this->paintCoverage();
     print "</body>\n</html>\n";
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:19,代码来源:HtmlReporterWithCoverage.php

示例15: save_code_coverage

function save_code_coverage()
{
    $coverage_directory = "/home/alice/twfy-coverage/";
    if (!file_exists($coverage_directory)) {
        mkdir($coverage_directory, 0777, TRUE);
    }
    global $coverage_identifier;
    $output_filename = $coverage_directory . $coverage_identifier;
    $coverage_data = xdebug_get_code_coverage();
    $fp = fopen($output_filename, "w");
    fwrite($fp, $output_filename . "\n");
    foreach ($coverage_data as $filename => $line_map) {
        fwrite($fp, $filename . "\n");
        foreach ($line_map as $line_number => $number_of_uses) {
            fwrite($fp, "  " . $line_number . ": " . $number_of_uses . "\n");
        }
    }
    fclose($fp);
    xdebug_stop_code_coverage();
}
开发者ID:henare,项目名称:theyworkforyou,代码行数:20,代码来源:instrument.php


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