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


PHP PHP_CodeCoverage::stop方法代码示例

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


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

示例1: afterExample

 public function afterExample(ExampleEvent $event)
 {
     if (!$this->enabled) {
         return;
     }
     $this->coverage->stop();
 }
开发者ID:addvilz,项目名称:phpspec-cover,代码行数:7,代码来源:Listener.php

示例2: __destruct

 /**
  * Save report
  */
 public function __destruct()
 {
     if ($this->_coverage) {
         $this->_coverage->stop();
         $report = new PHP_CodeCoverage_Report_PHP();
         $report->process($this->_coverage, $this->_covResult);
     }
 }
开发者ID:JBZoo,项目名称:CrossCMS,代码行数:11,代码来源:fake-index.php

示例3: getCoverageForFileWithIgnoredLines

 protected function getCoverageForFileWithIgnoredLines()
 {
     $coverage = new PHP_CodeCoverage($this->setUpXdebugStubForFileWithIgnoredLines(), new PHP_CodeCoverage_Filter());
     $coverage->start('FileWithIgnoredLines', TRUE);
     $coverage->stop();
     return $coverage;
 }
开发者ID:rdohms,项目名称:php-code-coverage,代码行数:7,代码来源:TestCase.php

示例4: getCoverageForClassWithAnonymousFunction

 protected function getCoverageForClassWithAnonymousFunction()
 {
     $coverage = new PHP_CodeCoverage($this->setUpXdebugStubForClassWithAnonymousFunction(), new PHP_CodeCoverage_Filter());
     $coverage->start('ClassWithAnonymousFunction', true);
     $coverage->stop();
     return $coverage;
 }
开发者ID:xiaobudongzhang,项目名称:php-code-coverage,代码行数:7,代码来源:TestCase.php

示例5: _stop

 /**
  * Stop or pause coverage proccess
  */
 protected function _stop()
 {
     if ($this->_isStart && $this->_coverage) {
         $this->_isStart = false;
         $this->_coverage->stop();
     }
 }
开发者ID:jbzoo,项目名称:phpunit,代码行数:10,代码来源:CovCatcher.php

示例6: renderCodeCoverage

 /**
  * Renders and outputs the code coverage report.
  *
  * @return void
  */
 protected function renderCodeCoverage()
 {
     $this->coverage->stop();
     $codeCoverageDirectory = PATH_site . 'typo3temp/codecoverage/';
     if (!is_readable($codeCoverageDirectory) && !is_dir($codeCoverageDirectory)) {
         t3lib_div::mkdir($codeCoverageDirectory);
     }
     $coverageReport = new PHP_CodeCoverage_Report_HTML();
     $coverageReport->process($this->coverage, $codeCoverageDirectory);
     $this->outputService->output('<p><a target="_blank" href="../typo3temp/codecoverage/index.html">' . 'Click here to access the Code Coverage report</a></p>' . '<p>Memory peak usage: ' . t3lib_div::formatSize(memory_get_peak_usage()) . 'B<p/>');
 }
开发者ID:chrmue01,项目名称:typo3-starter-kit,代码行数:16,代码来源:Module.php

示例7: function

     });
     $emitter->on('runner.end', function () use($coverage) {
         $coverage->stop();
         $writer = new PHP_CodeCoverage_Report_HTML();
         $writer->process($coverage, __DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'report');
     });
 }
 if ($codeCoverage == 'clover' && $shouldCover) {
     $coverage = new PHP_CodeCoverage();
     $emitter->on('runner.start', function () use($coverage) {
         $coverage->filter()->addDirectoryToWhitelist(__DIR__ . '/src');
         $coverage->filter()->removeFileFromWhitelist(__DIR__ . '/src/Dsl.php');
         $coverage->start('peridot');
     });
     $emitter->on('runner.end', function () use($coverage) {
         $coverage->stop();
         $writer = new PHP_CodeCoverage_Report_Clover();
         $writer->process($coverage, __DIR__ . DIRECTORY_SEPARATOR . 'build' . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . 'clover.xml');
     });
 }
 $emitter->on('peridot.start', function (Environment $env) use(&$coverage) {
     $definition = $env->getDefinition();
     $definition->option("banner", null, InputOption::VALUE_REQUIRED, "Custom banner text");
     $definition->getArgument('path')->setDefault('specs');
 });
 /**
  * Demonstrate registering a custom reporter via peridot config
  */
 $emitter->on('peridot.reporters', function ($input, $reporters) use(&$counts) {
     $banner = $input->getOption('banner');
     $reporters->register('basic', 'a simple summary', function (ReporterInterface $reporter) use(&$counts, $banner) {
开发者ID:peridot-php,项目名称:peridot,代码行数:31,代码来源:peridot.php

示例8: testStopThrowsExceptionForInvalidArgument2

 /**
  * @covers            PHP_CodeCoverage::stop
  * @expectedException PHP_CodeCoverage_Exception
  */
 public function testStopThrowsExceptionForInvalidArgument2()
 {
     $this->coverage->stop(TRUE, NULL);
 }
开发者ID:mrbadao,项目名称:api-official,代码行数:8,代码来源:CodeCoverageTest.php

示例9: stopAtStep

    $expected = '';
    if (file_exists($caseOut)) {
        $expected = file_get_contents($caseOut);
    }
    if ($got != $expected) {
        $brokenTests[$caseOut] = $got;
        if (isset($opt['stop'])) {
            $bailOut = true;
            break;
        }
        echo '!';
    } else {
        echo '.';
    }
    stopAtStep();
    $isCoverage && $coverage->stop();
}
$cases = glob(__DIR__ . '/tests-PSR/' . $testNumber . '*.in');
if (!$bailOut) {
    foreach ($cases as $caseIn) {
        ++$count;
        $isCoverage && $coverage->start($caseIn);
        $fmt = new CodeFormatter();
        $caseOut = str_replace('.in', '.out', $caseIn);
        $content = file_get_contents($caseIn);
        $tokens = token_get_all($content);
        $specialPasses = false;
        foreach ($tokens as $token) {
            list($id, $text) = getToken($token);
            if (T_COMMENT == $id && '//version:' == substr($text, 0, 10)) {
                $version = str_replace('//version:', '', $text);
开发者ID:nipsongarrido,项目名称:php.tools,代码行数:31,代码来源:test.php

示例10: main

 /**
  * Main method.
  */
 public static function main()
 {
     $input = new ezcConsoleInput();
     $input->registerOption(new ezcConsoleOption('', 'clover', ezcConsoleInput::TYPE_STRING));
     $input->registerOption(new ezcConsoleOption('', 'html', ezcConsoleInput::TYPE_STRING));
     $input->registerOption(new ezcConsoleOption('', 'php', ezcConsoleInput::TYPE_STRING));
     $input->registerOption(new ezcConsoleOption('', 'text', ezcConsoleInput::TYPE_STRING));
     $input->registerOption(new ezcConsoleOption('', 'blacklist', ezcConsoleInput::TYPE_STRING, array(), TRUE));
     $input->registerOption(new ezcConsoleOption('', 'whitelist', ezcConsoleInput::TYPE_STRING, array(), TRUE));
     $input->registerOption(new ezcConsoleOption('', 'merge', ezcConsoleInput::TYPE_NONE, FALSE));
     $input->registerOption(new ezcConsoleOption('', 'add-uncovered', ezcConsoleInput::TYPE_NONE, FALSE));
     $input->registerOption(new ezcConsoleOption('', 'process-uncovered', ezcConsoleInput::TYPE_NONE, FALSE));
     $input->registerOption(new ezcConsoleOption('h', 'help', ezcConsoleInput::TYPE_NONE, NULL, FALSE, '', '', array(), array(), FALSE, FALSE, TRUE));
     $input->registerOption(new ezcConsoleOption('v', 'version', ezcConsoleInput::TYPE_NONE, NULL, FALSE, '', '', array(), array(), FALSE, FALSE, TRUE));
     try {
         $input->process();
     } catch (ezcConsoleOptionException $e) {
         print $e->getMessage() . "\n";
         exit(1);
     }
     if ($input->getOption('help')->value) {
         self::showHelp();
         exit(0);
     } else {
         if ($input->getOption('version')->value) {
             self::printVersionString();
             exit(0);
         }
     }
     $arguments = $input->getArguments();
     $clover = $input->getOption('clover')->value;
     $html = $input->getOption('html')->value;
     $php = $input->getOption('php')->value;
     $text = $input->getOption('text')->value;
     $blacklist = $input->getOption('blacklist')->value;
     $whitelist = $input->getOption('whitelist')->value;
     $addUncovered = $input->getOption('add-uncovered')->value;
     $processUncovered = $input->getOption('process-uncovered')->value;
     $merge = $input->getOption('merge')->value;
     if (count($arguments) == 1) {
         self::printVersionString();
         $coverage = new PHP_CodeCoverage();
         $filter = $coverage->filter();
         if (empty($whitelist)) {
             $c = new ReflectionClass('ezcBase');
             $filter->addDirectoryToBlacklist(dirname($c->getFileName()));
             $c = new ReflectionClass('ezcConsoleInput');
             $filter->addDirectoryToBlacklist(dirname($c->getFileName()));
             foreach ($blacklist as $item) {
                 if (is_dir($item)) {
                     $filter->addDirectoryToBlacklist($item);
                 } else {
                     if (is_file($item)) {
                         $filter->addFileToBlacklist($item);
                     }
                 }
             }
         } else {
             $coverage->setAddUncoveredFilesFromWhitelist($addUncovered);
             $coverage->setProcessUncoveredFilesFromWhitelist($processUncovered);
             foreach ($whitelist as $item) {
                 if (is_dir($item)) {
                     $filter->addDirectoryToWhitelist($item);
                 } else {
                     if (is_file($item)) {
                         $filter->addFileToWhitelist($item);
                     }
                 }
             }
         }
         if (!$merge) {
             $coverage->start('phpcov');
             require $arguments[0];
             $coverage->stop();
         } else {
             $finder = new Symfony\Component\Finder\Finder();
             $finder->in($arguments[0])->name('*.cov');
             foreach ($finder as $file) {
                 $coverage->merge(unserialize(file_get_contents($file->getRealpath())));
             }
         }
         if ($clover) {
             $writer = new PHP_CodeCoverage_Report_Clover();
             $writer->process($coverage, $clover);
         }
         if ($html) {
             $writer = new PHP_CodeCoverage_Report_HTML();
             $writer->process($coverage, $html);
         }
         if ($php) {
             $writer = new PHP_CodeCoverage_Report_PHP();
             $writer->process($coverage, $php);
         }
         if ($text) {
             $writer = new PHP_CodeCoverage_Report_Text();
             $writer->process($coverage, $text);
         }
//.........这里部分代码省略.........
开发者ID:nagyist,项目名称:phpcov_ui,代码行数:101,代码来源:Command.php

示例11: shutdown

 public function shutdown(PHP_CodeCoverage $coverage)
 {
     $coverage->stop();
     $writer = new PHP_CodeCoverage_Report_PHP();
     $writer->process($coverage, __DIR__ . '/../../../build/logs/clover-child.cov');
 }
开发者ID:tiagobutzke,项目名称:phparallel,代码行数:6,代码来源:CoverageCollectorThread.php

示例12: stopRecordingCodeUsage

 public function stopRecordingCodeUsage()
 {
     $this->codeCoverageMonitor->stop();
 }
开发者ID:sam-burns,项目名称:behat-context-file-usage,代码行数:4,代码来源:PhpUnitCodeCoverageTool.php

示例13: stop

 public function stop($append = true, $linesToBeCovered = array(), array $linesToBeUsed = array())
 {
     if ($this->isEnabled()) {
         @$this->coverage->stop($append, $linesToBeCovered, $linesToBeUsed);
     }
 }
开发者ID:phpguard,项目名称:phpguard,代码行数:6,代码来源:CodeCoverageSession.php

示例14: getCoverageForClassWithAnonymousFunction

 protected function getCoverageForClassWithAnonymousFunction()
 {
     $filter = new PHP_CodeCoverage_Filter();
     $filter->addFileToWhitelist(TEST_FILES_PATH . 'source_with_class_and_anonymous_function.php');
     $coverage = new PHP_CodeCoverage($this->setUpXdebugStubForClassWithAnonymousFunction(), $filter);
     $coverage->start('ClassWithAnonymousFunction', true);
     $coverage->stop();
     return $coverage;
 }
开发者ID:CHRISTOPHERVANDOMME,项目名称:zf2complet,代码行数:9,代码来源:TestCase.php

示例15: afterScenario

 /**
  * After Scenario/Outline Example hook
  *
  * @param \Behat\Behat\EventDispatcher\Event\ScenarioTested $event
  */
 public function afterScenario(ScenarioTested $event)
 {
     $this->coverage->stop();
 }
开发者ID:vipsoft,项目名称:code-coverage-extension,代码行数:9,代码来源:EventListener.php


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