• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP xdebug_stop_code_coverage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: paintGroupEnd

 /**
  *    Paints coverage report if enabled.
  *    @param string $group     Name of test or other label.
  *    @access public
  */
 function paintGroupEnd($group)
 {
     $this->group = "";
     $cc = "";
     if ($this->cc) {
         if (extension_loaded('xdebug')) {
             $arrfiles = xdebug_get_code_coverage();
             xdebug_stop_code_coverage();
             $thisdir = dirname(__FILE__);
             $thisdirlen = strlen($thisdir);
             foreach ($arrfiles as $index => $file) {
                 if (substr($index, 0, $thisdirlen) === $thisdir) {
                     continue;
                 }
                 $lcnt = 0;
                 $ccnt = 0;
                 foreach ($file as $line) {
                     if ($line == -2) {
                         continue;
                     }
                     $lcnt++;
                     if ($line == 1) {
                         $ccnt++;
                     }
                 }
                 if ($lcnt > 0) {
                     $cc .= round($ccnt / $lcnt * 100, 2) . '%';
                 } else {
                     $cc .= "0.00%";
                 }
                 $cc .= "\t" . $index . "\n";
             }
         }
     }
     $this->listener->write('{status:"coverage",message:"' . EclipseReporter::escapeVal($cc) . '"}');
 }
开发者ID:reevoo,项目名称:reevoomark-php-api,代码行数:41,代码来源:eclipse.php


示例17: run

 /**
  * Runs a TestCase.
  *
  * @param  PHPUnit_Framework_Test $test
  */
 public function run(PHPUnit_Framework_Test $test)
 {
     PHPUnit_Framework_Assert::resetCount();
     $error = FALSE;
     $failure = FALSE;
     $this->startTest($test);
     $errorHandlerSet = FALSE;
     if ($this->convertErrorsToExceptions) {
         $oldErrorHandler = set_error_handler(array('PHPUnit_Util_ErrorHandler', 'handleError'), E_ALL | E_STRICT);
         if ($oldErrorHandler === NULL) {
             $errorHandlerSet = TRUE;
         } else {
             restore_error_handler();
         }
     }
     if (self::$xdebugLoaded === NULL) {
         self::$xdebugLoaded = extension_loaded('xdebug');
         self::$useXdebug = self::$xdebugLoaded;
     }
     $useXdebug = self::$useXdebug && $this->collectCodeCoverageInformation && !$test instanceof PHPUnit_Extensions_SeleniumTestCase;
     if ($useXdebug) {
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     }
     PHPUnit_Util_Timer::start();
     try {
         $test->runBare();
     } catch (PHPUnit_Framework_AssertionFailedError $e) {
         $failure = TRUE;
     } catch (Exception $e) {
         $error = TRUE;
     }
     $time = PHPUnit_Util_Timer::stop();
     if ($useXdebug) {
         $codeCoverage = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
         $this->appendCodeCoverageInformation($test, $codeCoverage);
     }
     if ($errorHandlerSet === TRUE) {
         restore_error_handler();
     }
     $test->addToAssertionCount(PHPUnit_Framework_Assert::getCount());
     if ($error === TRUE) {
         $this->addError($test, $e, $time);
     } else {
         if ($failure === TRUE) {
             $this->addFailure($test, $e, $time);
         }
     }
     $this->endTest($test, $time);
 }
开发者ID:swk,项目名称:bluebox,代码行数:55,代码来源:TestResult.php


示例18: stop

 /**
  * Stop collection of code coverage information.
  *
  * @return array
  */
 public function stop()
 {
     $data = xdebug_get_code_coverage();
     xdebug_stop_code_coverage();
     return $this->cleanup($data);
 }
开发者ID:ppwalks33,项目名称:cleansure,代码行数:11,代码来源:Xdebug.php


示例19: foreach

                    $data[$file] = $lines;
                } else {
                    foreach ($lines as $line => $flag) {
                        if (!isset($data[$file][$line]) || $flag > $data[$file][$line]) {
                            $data[$file][$line] = $flag;
                        }
                    }
                }
            }
        }
    }
    echo serialize($data);
    exit;
}
if (isset($_SERVER['HTTP_X_ENABLE_COVERAGE']) && isset($_SERVER['HTTP_X_TEST_SESSION_ID']) && extension_loaded('xdebug')) {
    // Register a shutdown function that stops code coverage and stores the coverage of the current
    // request
    register_shutdown_function(function () {
        $data = xdebug_get_code_coverage();
        xdebug_stop_code_coverage();
        $coverageDir = sys_get_temp_dir() . '/behat-coverage';
        if (is_dir($coverageDir) || mkdir($coverageDir, 0775, true)) {
            $filename = sprintf('%s/%s.%s.cov', $coverageDir, md5(uniqid('', true)), $_SERVER['HTTP_X_TEST_SESSION_ID']);
            file_put_contents($filename, serialize($data));
        }
    });
    // Start code coverage
    xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
}
// Return false from the router to serve the requested file as is
return false;
开发者ID:AlucardleVash,项目名称:tech.vg.no-1812,代码行数:31,代码来源:router.php


示例20: main

 function main()
 {
     $files = $this->getFilenames();
     $this->log("Setting up coverage database for " . count($files) . " files");
     $props = new Properties();
     foreach ($files as $file) {
         $fullname = $file['fullname'];
         $filename = $file['key'];
         $props->setProperty($filename, serialize(array('fullname' => $fullname, 'coverage' => array())));
     }
     $dbfile = new PhingFile($this->database);
     $props->store($dbfile);
     $this->project->setProperty('coverage.database', $dbfile->getAbsolutePath());
     foreach ($files as $file) {
         $fullname = $file['fullname'];
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED);
         Phing::__import($fullname, $this->classpath);
         $coverage = xdebug_get_code_coverage();
         xdebug_stop_code_coverage();
         CoverageMerger::merge($this->project, array($coverage));
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:22,代码来源:CoverageSetupTask.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP xdebug_stop_trace函数代码示例发布时间:2022-05-23
下一篇:
PHP xdebug_start_trace函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap