當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Runtime::hasXdebug方法代碼示例

本文整理匯總了PHP中SebastianBergmann\Environment\Runtime::hasXdebug方法的典型用法代碼示例。如果您正苦於以下問題:PHP Runtime::hasXdebug方法的具體用法?PHP Runtime::hasXdebug怎麽用?PHP Runtime::hasXdebug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SebastianBergmann\Environment\Runtime的用法示例。


在下文中一共展示了Runtime::hasXdebug方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param  PHP_CodeCoverage_Driver    $driver
  * @param  PHP_CodeCoverage_Filter    $filter
  * @throws PHP_CodeCoverage_Exception
  */
 public function __construct(PHP_CodeCoverage_Driver $driver = null, PHP_CodeCoverage_Filter $filter = null)
 {
     if ($driver === null) {
         $runtime = new Runtime();
         if (!$runtime->hasXdebug()) {
             throw new PHP_CodeCoverage_Exception('No code coverage driver available');
         }
         $driver = new PHP_CodeCoverage_Driver_Xdebug();
     }
     if ($filter === null) {
         $filter = new PHP_CodeCoverage_Filter();
     }
     $this->driver = $driver;
     $this->filter = $filter;
 }
開發者ID:iwillhappy1314,項目名稱:laravel-admin,代碼行數:22,代碼來源:CodeCoverage.php

示例2: doRun

 /**
  * @param  PHPUnit_Framework_Test       $suite
  * @param  array                        $arguments
  * @return PHPUnit_Framework_TestResult
  */
 public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
 {
     $this->handleConfiguration($arguments);
     $this->processSuiteFilters($suite, $arguments);
     if (isset($arguments['bootstrap'])) {
         $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap'];
     }
     if ($arguments['backupGlobals'] === false) {
         $suite->setBackupGlobals(false);
     }
     if ($arguments['backupStaticAttributes'] === true) {
         $suite->setBackupStaticAttributes(true);
     }
     if ($arguments['disallowChangesToGlobalState'] === true) {
         $suite->setDisallowChangesToGlobalState(true);
     }
     if (is_integer($arguments['repeat'])) {
         $test = new PHPUnit_Extensions_RepeatedTest($suite, $arguments['repeat'], $arguments['processIsolation']);
         $suite = new PHPUnit_Framework_TestSuite();
         $suite->addTest($test);
     }
     $result = $this->createTestResult();
     if (!$arguments['convertErrorsToExceptions']) {
         $result->convertErrorsToExceptions(false);
     }
     if (!$arguments['convertNoticesToExceptions']) {
         PHPUnit_Framework_Error_Notice::$enabled = false;
     }
     if (!$arguments['convertWarningsToExceptions']) {
         PHPUnit_Framework_Error_Warning::$enabled = false;
     }
     if ($arguments['stopOnError']) {
         $result->stopOnError(true);
     }
     if ($arguments['stopOnFailure']) {
         $result->stopOnFailure(true);
     }
     if ($arguments['stopOnIncomplete']) {
         $result->stopOnIncomplete(true);
     }
     if ($arguments['stopOnRisky']) {
         $result->stopOnRisky(true);
     }
     if ($arguments['stopOnSkipped']) {
         $result->stopOnSkipped(true);
     }
     if ($this->printer === null) {
         if (isset($arguments['printer']) && $arguments['printer'] instanceof PHPUnit_Util_Printer) {
             $this->printer = $arguments['printer'];
         } else {
             $printerClass = 'PHPUnit_TextUI_ResultPrinter';
             if (isset($arguments['printer']) && is_string($arguments['printer']) && class_exists($arguments['printer'], false)) {
                 $class = new ReflectionClass($arguments['printer']);
                 if ($class->isSubclassOf('PHPUnit_TextUI_ResultPrinter')) {
                     $printerClass = $arguments['printer'];
                 }
             }
             $this->printer = new $printerClass(isset($arguments['stderr']) ? 'php://stderr' : null, $arguments['verbose'], $arguments['colors'], $arguments['debug'], $arguments['columns']);
         }
     }
     if (!$this->printer instanceof PHPUnit_Util_Log_TAP) {
         $this->printer->write(PHPUnit_Runner_Version::getVersionString() . "\n");
         self::$versionStringPrinted = true;
         if ($arguments['verbose']) {
             $this->printer->write(sprintf("\nRuntime:\t%s", $this->runtime->getNameWithVersion()));
             if ($this->runtime->hasXdebug()) {
                 $this->printer->write(sprintf(" with Xdebug %s", phpversion('xdebug')));
             }
             if (isset($arguments['configuration'])) {
                 $this->printer->write(sprintf("\nConfiguration:\t%s", $arguments['configuration']->getFilename()));
             }
             $this->printer->write("\n");
         }
         if (isset($arguments['deprecatedStrictModeOption'])) {
             print "Warning:\tDeprecated option \"--strict\" used\n";
         } elseif (isset($arguments['deprecatedStrictModeSetting'])) {
             print "Warning:\tDeprecated configuration setting \"strict\" used\n";
         }
         if (isset($arguments['deprecatedSeleniumConfiguration'])) {
             print "Warning:\tDeprecated configuration setting \"selenium\" used\n";
         }
     }
     foreach ($arguments['listeners'] as $listener) {
         $result->addListener($listener);
     }
     $result->addListener($this->printer);
     if (isset($arguments['testdoxHTMLFile'])) {
         $result->addListener(new PHPUnit_Util_TestDox_ResultPrinter_HTML($arguments['testdoxHTMLFile']));
     }
     if (isset($arguments['testdoxTextFile'])) {
         $result->addListener(new PHPUnit_Util_TestDox_ResultPrinter_Text($arguments['testdoxTextFile']));
     }
     $codeCoverageReports = 0;
     if (isset($arguments['coverageClover'])) {
         $codeCoverageReports++;
//.........這裏部分代碼省略.........
開發者ID:mubassirhayat,項目名稱:Laravel51-starter,代碼行數:101,代碼來源:TestRunner.php

示例3: testXdebugCanBeDetected

 /**
  * @covers \SebastianBergmann\Environment\Runtime::hasXdebug
  *
  * @uses   \SebastianBergmann\Environment\Runtime::isHHVM
  * @uses   \SebastianBergmann\Environment\Runtime::isPHP
  */
 public function testXdebugCanBeDetected()
 {
     $this->assertInternalType('boolean', $this->env->hasXdebug());
 }
開發者ID:baardbaard,項目名稱:bb-twitterfeed,代碼行數:10,代碼來源:RuntimeTest.php

示例4: doRun

 /**
  * @param PHPUnit_Framework_Test $suite
  * @param array                  $arguments
  * @param bool                   $exit
  *
  * @return PHPUnit_Framework_TestResult
  */
 public function doRun(PHPUnit_Framework_Test $suite, array $arguments = [], $exit)
 {
     if (isset($arguments['configuration'])) {
         $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] = $arguments['configuration'];
     }
     $this->handleConfiguration($arguments);
     $this->processSuiteFilters($suite, $arguments);
     if (isset($arguments['bootstrap'])) {
         $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap'];
     }
     if ($arguments['backupGlobals'] === false) {
         $suite->setBackupGlobals(false);
     }
     if ($arguments['backupStaticAttributes'] === true) {
         $suite->setBackupStaticAttributes(true);
     }
     if ($arguments['beStrictAboutChangesToGlobalState'] === true) {
         $suite->setbeStrictAboutChangesToGlobalState(true);
     }
     if (is_integer($arguments['repeat'])) {
         $test = new PHPUnit_Extensions_RepeatedTest($suite, $arguments['repeat'], $arguments['processIsolation']);
         $suite = new PHPUnit_Framework_TestSuite();
         $suite->addTest($test);
     }
     $result = $this->createTestResult();
     if (!$arguments['convertErrorsToExceptions']) {
         $result->convertErrorsToExceptions(false);
     }
     if (!$arguments['convertNoticesToExceptions']) {
         PHPUnit_Framework_Error_Notice::$enabled = false;
     }
     if (!$arguments['convertWarningsToExceptions']) {
         PHPUnit_Framework_Error_Warning::$enabled = false;
     }
     if ($arguments['stopOnError']) {
         $result->stopOnError(true);
     }
     if ($arguments['stopOnFailure']) {
         $result->stopOnFailure(true);
     }
     if ($arguments['stopOnWarning']) {
         $result->stopOnWarning(true);
     }
     if ($arguments['stopOnIncomplete']) {
         $result->stopOnIncomplete(true);
     }
     if ($arguments['stopOnRisky']) {
         $result->stopOnRisky(true);
     }
     if ($arguments['stopOnSkipped']) {
         $result->stopOnSkipped(true);
     }
     if ($this->printer === null) {
         if (isset($arguments['printer']) && $arguments['printer'] instanceof PHPUnit_Util_Printer) {
             $this->printer = $arguments['printer'];
         } else {
             $printerClass = 'PHPUnit_TextUI_ResultPrinter';
             if (isset($arguments['printer']) && is_string($arguments['printer']) && class_exists($arguments['printer'], false)) {
                 $class = new ReflectionClass($arguments['printer']);
                 if ($class->isSubclassOf('PHPUnit_TextUI_ResultPrinter')) {
                     $printerClass = $arguments['printer'];
                 }
             }
             $this->printer = new $printerClass(isset($arguments['stderr']) ? 'php://stderr' : null, $arguments['verbose'], $arguments['colors'], $arguments['debug'], $arguments['columns'], $arguments['reverseList']);
         }
     }
     if (!$this->printer instanceof PHPUnit_Util_Log_TAP) {
         $this->printer->write(PHPUnit_Runner_Version::getVersionString() . "\n");
         self::$versionStringPrinted = true;
         if ($arguments['verbose']) {
             $runtime = $this->runtime->getNameWithVersion();
             if ($this->runtime->hasXdebug()) {
                 $runtime .= sprintf(' with Xdebug %s', phpversion('xdebug'));
             }
             $this->writeMessage('Runtime', $runtime);
             if (isset($arguments['configuration'])) {
                 $this->writeMessage('Configuration', $arguments['configuration']->getFilename());
             }
         }
         if (isset($arguments['deprecatedCheckForUnintentionallyCoveredCodeSettingUsed'])) {
             print "Warning:       Deprecated configuration setting \"checkForUnintentionallyCoveredCode\" used\n";
         }
     }
     foreach ($arguments['listeners'] as $listener) {
         $result->addListener($listener);
     }
     $result->addListener($this->printer);
     if (isset($arguments['testdoxHTMLFile'])) {
         $result->addListener(new PHPUnit_Util_TestDox_ResultPrinter_HTML($arguments['testdoxHTMLFile']));
     }
     if (isset($arguments['testdoxTextFile'])) {
         $result->addListener(new PHPUnit_Util_TestDox_ResultPrinter_Text($arguments['testdoxTextFile']));
     }
//.........這裏部分代碼省略.........
開發者ID:tknplt,項目名稱:phpunit,代碼行數:101,代碼來源:TestRunner.php

示例5: __construct

 /**
  * Constructor.
  *
  * @param  PHP_CodeCoverage_Driver $driver
  * @param  PHP_CodeCoverage_Filter $filter
  * @throws PHP_CodeCoverage_Exception
  */
 public function __construct(PHP_CodeCoverage_Driver $driver = null, PHP_CodeCoverage_Filter $filter = null)
 {
     if ($filter === null) {
         $filter = new PHP_CodeCoverage_Filter();
     }
     $parser = new PHP_CodeCoverage_Parser();
     if ($driver === null) {
         $runtime = new Runtime();
         if ($runtime->isHHVM()) {
             $driver = new PHP_CodeCoverage_Driver_HHVM($filter, $parser);
         } elseif ($runtime->hasXdebug()) {
             $driver = new PHP_CodeCoverage_Driver_Xdebug($filter, $parser);
         } else {
             throw new PHP_CodeCoverage_Exception('No code coverage driver available');
         }
     }
     $this->driver = $driver;
     $this->filter = $filter;
     $this->parser = $parser;
 }
開發者ID:limweb,項目名稱:webappservice,代碼行數:27,代碼來源:CodeCoverage.php

示例6: getRuntimeString

 /**
  * @return string
  */
 private function getRuntimeString()
 {
     $runtime = new Runtime();
     $buffer = sprintf('<a href="%s" target="_top">%s %s</a>', $runtime->getVendorUrl(), $runtime->getName(), $runtime->getVersion());
     if ($runtime->hasXdebug() && !$runtime->hasPHPDBGCodeCoverage()) {
         $buffer .= sprintf(' with <a href="https://xdebug.org/">Xdebug %s</a>', phpversion('xdebug'));
     }
     return $buffer;
 }
開發者ID:nsandlin,項目名稱:linepig,代碼行數:12,代碼來源:Renderer.php


注:本文中的SebastianBergmann\Environment\Runtime::hasXdebug方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。