當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。