本文整理汇总了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();
}
示例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);
}
}
示例3: getCoverageForFileWithIgnoredLines
protected function getCoverageForFileWithIgnoredLines()
{
$coverage = new PHP_CodeCoverage($this->setUpXdebugStubForFileWithIgnoredLines(), new PHP_CodeCoverage_Filter());
$coverage->start('FileWithIgnoredLines', TRUE);
$coverage->stop();
return $coverage;
}
示例4: getCoverageForClassWithAnonymousFunction
protected function getCoverageForClassWithAnonymousFunction()
{
$coverage = new PHP_CodeCoverage($this->setUpXdebugStubForClassWithAnonymousFunction(), new PHP_CodeCoverage_Filter());
$coverage->start('ClassWithAnonymousFunction', true);
$coverage->stop();
return $coverage;
}
示例5: _stop
/**
* Stop or pause coverage proccess
*/
protected function _stop()
{
if ($this->_isStart && $this->_coverage) {
$this->_isStart = false;
$this->_coverage->stop();
}
}
示例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/>');
}
示例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) {
示例8: testStopThrowsExceptionForInvalidArgument2
/**
* @covers PHP_CodeCoverage::stop
* @expectedException PHP_CodeCoverage_Exception
*/
public function testStopThrowsExceptionForInvalidArgument2()
{
$this->coverage->stop(TRUE, NULL);
}
示例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);
示例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);
}
//.........这里部分代码省略.........
示例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');
}
示例12: stopRecordingCodeUsage
public function stopRecordingCodeUsage()
{
$this->codeCoverageMonitor->stop();
}
示例13: stop
public function stop($append = true, $linesToBeCovered = array(), array $linesToBeUsed = array())
{
if ($this->isEnabled()) {
@$this->coverage->stop($append, $linesToBeCovered, $linesToBeUsed);
}
}
示例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;
}
示例15: afterScenario
/**
* After Scenario/Outline Example hook
*
* @param \Behat\Behat\EventDispatcher\Event\ScenarioTested $event
*/
public function afterScenario(ScenarioTested $event)
{
$this->coverage->stop();
}