本文整理汇总了PHP中xdebug_start_code_coverage函数的典型用法代码示例。如果您正苦于以下问题:PHP xdebug_start_code_coverage函数的具体用法?PHP xdebug_start_code_coverage怎么用?PHP xdebug_start_code_coverage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xdebug_start_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: 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
示例16: resumeCodeCoverage
public static function resumeCodeCoverage($force_start = false)
{
if (true === self::$coverageStopped || true === $force_start) {
if (function_exists('xdebug_start_code_coverage')) {
$started = xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
self::$coverageStopped = false;
return $started;
}
}
return;
}
开发者ID:jaydiablo,项目名称:xdebug-test-case,代码行数:11,代码来源:TestHelper.php
示例17: drushMain
/**
* Calls a Drush command.
*
* This is an exact copy of drush_main from drush.php, but that file
* cannot be loaded because it produces side effects.
*
* @see drush_main
*
* @return int|string
*/
protected static function drushMain()
{
$return = '';
// 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');
}
/* Set up bootstrap object, so that
* - 'early' files can bootstrap when needed.
* - bootstrap constants are available.
*/
$bootstrap_class = drush_get_option('bootstrap_class', 'Drush\\Boot\\DrupalBoot');
$bootstrap = new $bootstrap_class();
drush_set_context('DRUSH_BOOTSTRAP_OBJECT', $bootstrap);
$bootstrap->preflight();
// Process initial global options such as --debug.
_drush_preflight_global_options();
$return = '';
drush_preflight();
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) {
$bootstrap = drush_get_context('DRUSH_BOOTSTRAP_OBJECT');
$return = $bootstrap->bootstrap_and_dispatch();
}
}
}
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:bangpound,项目名称:drupal-bridge,代码行数:64,代码来源:ScriptHandler.php
示例18: init
public static function init()
{
if (array_key_exists('tracefile', $_GET)) {
exit(highlight_file($_GET['tracefile'], true));
}
if (array_key_exists('mirror', $_GET)) {
exit(self::getCacheFile($_GET['mirror']));
}
self::instance()->classes = get_declared_classes();
self::instance()->functions = get_defined_functions();
error_reporting(E_ALL | E_STRICT);
function_exists('xdebug_start_code_coverage') && xdebug_start_code_coverage();
self::add('Environment', array('_GET' => $_GET, '_POST' => $_POST, '_COOKIE' => $_COOKIE, '_SERVER' => $_SERVER));
}
开发者ID:sdgdsffdsfff,项目名称:tracer-1,代码行数:14,代码来源:tracer.php
示例19: 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
示例20: start
public static function start($reportDir = null, $userStory = null)
{
if ($reportDir != null) {
self::initialize($reportDir);
}
if (function_exists('xdebug_start_code_coverage')) {
if (!empty($userStory)) {
file_put_contents(self::$userStoryFileName, $userStory);
} else {
$userStory = self::getUserStoryFromFile();
}
if ($userStory != self::CODE_COVERAGE_OFF) {
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
}
}
}
开发者ID:vitalyspirin,项目名称:codecoverage,代码行数:16,代码来源:CodeCoverage.php
注:本文中的xdebug_start_code_coverage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论