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


PHP xdebug_start_code_coverage函数代码示例

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


在下文中一共展示了xdebug_start_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: WebLauncher

 /**
  * Launches a test module for web inspection of results
  * @param string $module
  * @return boolean
  */
 function WebLauncher($module)
 {
     jf::$ErrorHandler->UnsetErrorHandler();
     $this->LoadFramework();
     self::$TestSuite = new \PHPUnit_Framework_TestSuite();
     self::$TestFiles[] = $this->ModuleFile($module);
     self::$TestSuite->addTestFile(self::$TestFiles[0]);
     $result = new \PHPUnit_Framework_TestResult();
     $listener = new TestListener();
     $result->addListener($listener);
     $Profiler = new Profiler();
     if (function_exists("xdebug_start_code_coverage")) {
         xdebug_start_code_coverage();
     }
     self::$TestSuite->run($result);
     if (function_exists("xdebug_start_code_coverage")) {
         $Coverage = xdebug_get_code_coverage();
     } else {
         $Coverage = null;
     }
     $Profiler->Stop();
     $listener->Finish();
     $this->OutputResult($result, $Profiler, $Coverage);
     return true;
 }
开发者ID:michalkoczwara,项目名称:WebGoatPHP,代码行数:30,代码来源:test.php

示例3: drush_main

/**
 * The main Drush function.
 *
 * - Runs "early" option code, if set (see global options).
 * - Parses the command line arguments, configuration files and environment.
 * - Prepares and executes a Drupal bootstrap, if possible,
 * - Dispatches the given command.
 *
 * function_exists('drush_main') may be used by modules to detect whether
 * they are being called from Drush.  See http://drupal.org/node/1181308
 * and http://drupal.org/node/827478
 *
 * @return mixed
 *   Whatever the given command returns.
 */
function drush_main()
{
    // Load Drush core include files, and parse command line arguments.
    require dirname(__FILE__) . '/includes/preflight.inc';
    if (drush_preflight_prepare() === FALSE) {
        return 1;
    }
    // Start code coverage collection.
    if ($coverage_file = drush_get_option('drush-coverage', FALSE)) {
        drush_set_context('DRUSH_CODE_COVERAGE', $coverage_file);
        xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
        register_shutdown_function('drush_coverage_shutdown');
    }
    // Load the global Drush configuration files, and global Drush commands.
    // Find the selected site based on --root, --uri or cwd
    // Preflight the selected site, and load any configuration and commandfiles associated with it.
    // Select and return the bootstrap class.
    $bootstrap = drush_preflight();
    // Reset our bootstrap phase to the beginning
    drush_set_context('DRUSH_BOOTSTRAP_PHASE', DRUSH_BOOTSTRAP_NONE);
    $return = '';
    if (!drush_get_error()) {
        if ($file = drush_get_option('early', FALSE)) {
            require_once $file;
            $function = 'drush_early_' . basename($file, '.inc');
            if (function_exists($function)) {
                if ($return = $function()) {
                    // If the function returns FALSE, we continue and attempt to bootstrap
                    // as normal. Otherwise, we exit early with the returned output.
                    if ($return === TRUE) {
                        $return = '';
                    }
                }
            }
        } else {
            // Do any necessary preprocessing operations on the command,
            // perhaps handling immediately.
            $command_handled = drush_preflight_command_dispatch();
            if (!$command_handled) {
                $return = $bootstrap->bootstrap_and_dispatch();
            }
        }
    }
    // TODO: Get rid of global variable access here, and just trust
    // the bootstrap object returned from drush_preflight().  This will
    // require some adjustments to Drush bootstrapping.
    // See: https://github.com/drush-ops/drush/pull/1303
    if ($bootstrap = drush_get_bootstrap_object()) {
        $bootstrap->terminate();
    }
    drush_postflight();
    // How strict are we?  If we are very strict, turn 'ok' into 'error'
    // if there are any warnings in the log.
    if ($return == 0 && drush_get_option('strict') > 1 && drush_log_has_errors()) {
        $return = 1;
    }
    // After this point the drush_shutdown function will run,
    // exiting with the correct exit code.
    return $return;
}
开发者ID:dasrecht,项目名称:drush,代码行数:75,代码来源:drush.php

示例4: coverageStart

 /**
  * Starts the code coverage
  *
  * @return void
  */
 public static function coverageStart()
 {
     if (!extension_loaded("xdebug")) {
         return;
     }
     xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
 }
开发者ID:eserozvataf,项目名称:scabbia2-testing,代码行数:12,代码来源:Testing.php

示例5: start

 /**
  * Begin code coverage checks
  *
  * @access public
  * @param ReportInterface $report The report to add information to
  * @return void
  */
 public function start(ReportInterface $report)
 {
     if (function_exists('xdebug_start_code_coverage')) {
         $this->started = TRUE;
         $this->report = $report;
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     }
 }
开发者ID:dotink,项目名称:lab,代码行数:15,代码来源:Engine.php

示例6: start

 /**
  * Starts code coverage.
  */
 public function start()
 {
     //@see bug https://github.com/facebook/hhvm/issues/4752
     try {
         xdebug_start_code_coverage($this->_config['coverage']);
     } catch (Exception $e) {
     }
 }
开发者ID:crysalead,项目名称:kahlan,代码行数:11,代码来源:Xdebug.php

示例7: paintGroupStart

 /**
  * Paints the start of a group test. Will also paint
  * the page header and footer if this is the
  * first test. Will stash the size if the first start.
  * @param string $test_name   Name of test that is starting.
  * @param integer $size       Number of test cases starting.
  */
 function paintGroupStart($test_name, $size)
 {
     $this->time = $this->getMicrotime();
     HtmlReporter::paintGroupStart($test_name, $size);
     if (extension_loaded('xdebug')) {
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     }
 }
开发者ID:clickdimension,项目名称:tinybutstrong,代码行数:15,代码来源:HtmlCodeCoverageReporter.php

示例8: start

 /**
  * Starts gathering the information for code coverage.
  * @param  string
  * @return void
  */
 public static function start($file)
 {
     self::$file = $file;
     xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     register_shutdown_function(function () {
         register_shutdown_function(array(__CLASS__, 'save'));
     });
 }
开发者ID:jakuborava,项目名称:walletapp,代码行数:13,代码来源:Collector.php

示例9: start

 /**
  * Start collection of code coverage information.
  *
  * @param bool $determineUnusedAndDead
  */
 public function start($determineUnusedAndDead = true)
 {
     if ($determineUnusedAndDead) {
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     } else {
         xdebug_start_code_coverage();
     }
 }
开发者ID:thanghexp,项目名称:project,代码行数:13,代码来源:Xdebug.php

示例10: startCoverage

 public function startCoverage()
 {
     $this->root = getcwd();
     if (!extension_loaded('xdebug')) {
         throw new Exception('Could not load xdebug extension');
     }
     xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
 }
开发者ID:guicara,项目名称:simpletest,代码行数:8,代码来源:coverage.php

示例11: startCodeCoverage

 public function startCodeCoverage()
 {
     //echo "startCodeCoverage called...\n";
     if (extension_loaded('xdebug')) {
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
         //echo "xdebug_start_code_coverage called...\n";
     }
 }
开发者ID:kitware,项目名称:cdash,代码行数:8,代码来源:kw_web_tester.php

示例12: __construct

 /**
  *
  */
 public function __construct()
 {
     if (is_callable("xdebug_start_code_coverage") && $this->getClassFileName()) {
         xdebug_stop_code_coverage();
         xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     } else {
         echo __METHOD__ . ": Unsupported code coverage.";
     }
 }
开发者ID:clagiordano,项目名称:weblibs,代码行数:12,代码来源:EmptyTest.php

示例13: startCodeCoverageAnalysis

 public static function startCodeCoverageAnalysis()
 {
     if (self::isCodeCoverageAnalysisRunning()) {
         return;
     }
     self::clearCodeCoverageReport();
     self::perparePhpIni();
     xdebug_start_code_coverage();
     self::$m_isCodeCoverageAnalysisRunning = true;
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.test,代码行数:10,代码来源:xdebug.php

示例14: generar_layout

 function generar_layout()
 {
     $selecciones = $this->controlador->get_selecciones();
     echo "<div style='background-color: white; border: 1px solid black; text-align: left; padding: 15px'>";
     try {
         //Se construye un suite por categoria que tenga test seleccionados
         foreach (toba_test_lista_casos::get_categorias() as $categoria) {
             $test = new GroupTest($categoria['nombre']);
             $hay_uno = false;
             foreach (toba_test_lista_casos::get_casos() as $caso) {
                 if ($caso['categoria'] == $categoria['id'] && in_array($caso['id'], $selecciones['casos'])) {
                     $hay_uno = true;
                     require_once $caso['archivo'];
                     $test->addTestCase(new $caso['id']($caso['nombre']));
                 }
             }
             if ($hay_uno) {
                 //--- COBERTURA DE CODIGO (OPCIONAL) ----
                 if (function_exists('xdebug_start_code_coverage')) {
                     xdebug_start_code_coverage();
                 }
                 //-------
                 $test->run(new toba_test_reporter());
                 //--- COBERTURA DE CODIGO (OPCIONAL) ----
                 $arch = 'PHPUnit2/Util/CodeCoverage/Renderer.php';
                 $existe = toba_manejador_archivos::existe_archivo_en_path($arch);
                 if (function_exists('xdebug_start_code_coverage') && $existe) {
                     require_once $arch;
                     $cubiertos = xdebug_get_code_coverage();
                     //Se limpian las referencias a simpletest y a librerias de testing en gral.
                     $archivos = array();
                     foreach (array_keys($cubiertos) as $archivo) {
                         if (!strpos($archivo, 'simpletest') && !strpos($archivo, 'PHPUnit') && !strpos($archivo, 'testing_automatico/') && !strpos($archivo, '/test_')) {
                             $archivos[$archivo] = $cubiertos[$archivo];
                         }
                     }
                     $cc = PHPUnit2_Util_CodeCoverage_Renderer::factory('HTML', array('tests' => $archivos));
                     $path_temp = toba::proyecto()->get_path_temp_www();
                     $salida = $path_temp['real'] . '/cobertura.html';
                     $cc->renderToFile($salida);
                     echo "<a href='{$path_temp['browser']}/cobertura.html' target='_blank'>Ver cobertura de código</a>";
                 }
                 //-------
             }
         }
     } catch (Exception $e) {
         if (method_exists($e, 'mensaje_web')) {
             echo ei_mensaje($e->mensaje_web(), 'error');
         } else {
             echo $e;
         }
     }
     echo '</div><br>';
     $this->dep('lista_archivos')->generar_html();
 }
开发者ID:emma5021,项目名称:toba,代码行数:55,代码来源:casos_web.php

示例15: start

 /**
  * Starts gathering the information for code coverage.
  * @param  string
  * @return void
  */
 public static function start($file)
 {
     if (!extension_loaded('xdebug')) {
         throw new \Exception('Code coverage functionality requires Xdebug extension.');
     }
     self::$file = fopen($file, 'a+');
     xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
     register_shutdown_function(function () {
         register_shutdown_function(array(__CLASS__, 'save'));
     });
 }
开发者ID:xnovk,项目名称:test,代码行数:16,代码来源:Collector.php


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