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


PHP PHP_CodeCoverage::setCacheTokens方法代碼示例

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


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

示例1: testSetCacheTokens

 /**
  * @covers PHP_CodeCoverage::setCacheTokens
  */
 public function testSetCacheTokens()
 {
     $this->coverage->setCacheTokens(true);
     $this->assertAttributeEquals(true, 'cacheTokens', $this->coverage);
 }
開發者ID:limweb,項目名稱:webappservice,代碼行數:8,代碼來源:CodeCoverageTest.php

示例2: testSetCacheTokens

 /**
  * @covers PHP_CodeCoverage::setCacheTokens
  */
 public function testSetCacheTokens()
 {
     $coverage = new PHP_CodeCoverage();
     $coverage->setCacheTokens(TRUE);
     $this->assertAttributeEquals(TRUE, 'cacheTokens', $coverage);
 }
開發者ID:nizarbey,項目名稱:phpunit-all-in-one,代碼行數:9,代碼來源:CodeCoverageTest.php

示例3: 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);
     if (isset($arguments['bootstrap'])) {
         $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap'];
     }
     if ($arguments['backupGlobals'] === FALSE) {
         $suite->setBackupGlobals(FALSE);
     }
     if ($arguments['backupStaticAttributes'] === TRUE) {
         $suite->setBackupStaticAttributes(TRUE);
     }
     if (is_integer($arguments['repeat'])) {
         $suite = new PHPUnit_Extensions_RepeatedTest($suite, $arguments['repeat'], $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     }
     $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['stopOnSkipped']) {
         $result->stopOnSkipped(TRUE);
     }
     if ($this->printer === NULL) {
         if (isset($arguments['printer']) && $arguments['printer'] instanceof PHPUnit_Util_Printer) {
             $this->printer = $arguments['printer'];
         } else {
             $this->printer = new PHPUnit_TextUI_ResultPrinter(NULL, $arguments['verbose'], $arguments['colors'], $arguments['debug']);
         }
     }
     if (!$this->printer instanceof PHPUnit_Util_Log_TAP && !self::$versionStringPrinted) {
         $this->printer->write(PHPUnit_Runner_Version::getVersionString() . "\n\n");
         if (isset($arguments['configuration'])) {
             $this->printer->write(sprintf("Configuration read from %s\n\n", $arguments['configuration']->getFilename()));
         }
     }
     foreach ($arguments['listeners'] as $listener) {
         $result->addListener($listener);
     }
     $result->addListener($this->printer);
     if ($this->printer instanceof PHPUnit_TextUI_ResultPrinter) {
         $result->addListener(new PHPUnit_Util_DeprecatedFeature_Logger());
     }
     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']));
     }
     if ((isset($arguments['coverageClover']) || isset($arguments['reportDirectory']) || isset($arguments['coveragePHP']) || isset($arguments['coverageText'])) && extension_loaded('xdebug')) {
         $codeCoverage = new PHP_CodeCoverage(NULL, $this->codeCoverageFilter);
         $codeCoverage->setProcessUncoveredFilesFromWhitelist($arguments['addUncoveredFilesFromWhitelist']);
         if (isset($arguments['cacheTokens'])) {
             $codeCoverage->setCacheTokens($arguments['cacheTokens']);
         }
         if (isset($arguments['forceCoversAnnotation'])) {
             $codeCoverage->setForceCoversAnnotation($arguments['forceCoversAnnotation']);
         }
         if (isset($arguments['mapTestClassNameToCoveredClassName'])) {
             $codeCoverage->setMapTestClassNameToCoveredClassName($arguments['mapTestClassNameToCoveredClassName']);
         }
         $result->setCodeCoverage($codeCoverage);
     }
     if (isset($arguments['jsonLogfile'])) {
         $result->addListener(new PHPUnit_Util_Log_JSON($arguments['jsonLogfile']));
     }
     if (isset($arguments['tapLogfile'])) {
         $result->addListener(new PHPUnit_Util_Log_TAP($arguments['tapLogfile']));
     }
     if (isset($arguments['junitLogfile'])) {
         $result->addListener(new PHPUnit_Util_Log_JUnit($arguments['junitLogfile'], $arguments['logIncompleteSkipped']));
     }
     if ($arguments['strict']) {
         $result->strictMode(TRUE);
         $result->setTimeoutForSmallTests($arguments['timeoutForSmallTests']);
         $result->setTimeoutForMediumTests($arguments['timeoutForMediumTests']);
         $result->setTimeoutForLargeTests($arguments['timeoutForLargeTests']);
     }
     $suite->run($result, $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     unset($suite);
     $result->flushListeners();
//.........這裏部分代碼省略.........
開發者ID:DaveNascimento,項目名稱:civicrm-packages,代碼行數:101,代碼來源:TestRunner.php

示例4: handleConfiguration


//.........這裏部分代碼省略.........
            $filterConfiguration = $arguments['configuration']->getFilterConfiguration();

            $filter = $this->codeCoverage->filter();

            foreach ($filterConfiguration['blacklist']['include']['directory'] as $dir) {
                $filter->addDirectoryToBlacklist(
                  $dir['path'], $dir['suffix'], $dir['prefix'], $dir['group']
                );
            }

            foreach ($filterConfiguration['blacklist']['include']['file'] as $file) {
                $filter->addFileToBlacklist($file);
            }

            foreach ($filterConfiguration['blacklist']['exclude']['directory'] as $dir) {
                $filter->removeDirectoryFromBlacklist(
                  $dir['path'], $dir['suffix'], $dir['prefix'], $dir['group']
                );
            }

            foreach ($filterConfiguration['blacklist']['exclude']['file'] as $file) {
                $filter->removeFileFromBlacklist($file);
            }

            if ((isset($arguments['coverageClover']) ||
                isset($arguments['reportDirectory'])) &&
                extension_loaded('xdebug')) {
                $this->codeCoverage->setProcessUncoveredFilesFromWhitelist(
                  $filterConfiguration['whitelist']['addUncoveredFilesFromWhitelist']
                );

                if (isset($arguments['forceCoversAnnotation'])) {
                    $this->codeCoverage->setForceCoversAnnotation(
                      $arguments['forceCoversAnnotation']
                    );
                }

                if (isset($arguments['mapTestClassNameToCoveredClassName'])) {
                    $this->codeCoverage->setMapTestClassNameToCoveredClassName(
                      $arguments['mapTestClassNameToCoveredClassName']
                    );
                }

                foreach ($filterConfiguration['whitelist']['include']['directory'] as $dir) {
                    $filter->addDirectoryToWhitelist(
                      $dir['path'], $dir['suffix'], $dir['prefix']
                    );
                }

                foreach ($filterConfiguration['whitelist']['include']['file'] as $file) {
                    $filter->addFileToWhitelist($file);
                }

                foreach ($filterConfiguration['whitelist']['exclude']['directory'] as $dir) {
                    $filter->removeDirectoryFromWhitelist(
                      $dir['path'], $dir['suffix'], $dir['prefix']
                    );
                }

                foreach ($filterConfiguration['whitelist']['exclude']['file'] as $file) {
                    $filter->removeFileFromWhitelist($file);
                }
            }
        }

        $arguments['backupGlobals']               = isset($arguments['backupGlobals'])               ? $arguments['backupGlobals']               : NULL;
        $arguments['backupStaticAttributes']      = isset($arguments['backupStaticAttributes'])      ? $arguments['backupStaticAttributes']      : NULL;
        $arguments['cacheTokens']                 = isset($arguments['cacheTokens'])                 ? $arguments['cacheTokens']                 : TRUE;
        $arguments['colors']                      = isset($arguments['colors'])                      ? $arguments['colors']                      : FALSE;
        $arguments['convertErrorsToExceptions']   = isset($arguments['convertErrorsToExceptions'])   ? $arguments['convertErrorsToExceptions']   : TRUE;
        $arguments['convertNoticesToExceptions']  = isset($arguments['convertNoticesToExceptions'])  ? $arguments['convertNoticesToExceptions']  : TRUE;
        $arguments['convertWarningsToExceptions'] = isset($arguments['convertWarningsToExceptions']) ? $arguments['convertWarningsToExceptions'] : TRUE;
        $arguments['excludeGroups']               = isset($arguments['excludeGroups'])               ? $arguments['excludeGroups']               : array();
        $arguments['groups']                      = isset($arguments['groups'])                      ? $arguments['groups']                      : array();
        $arguments['logIncompleteSkipped']        = isset($arguments['logIncompleteSkipped'])        ? $arguments['logIncompleteSkipped']        : FALSE;
        $arguments['processIsolation']            = isset($arguments['processIsolation'])            ? $arguments['processIsolation']            : FALSE;
        $arguments['repeat']                      = isset($arguments['repeat'])                      ? $arguments['repeat']                      : FALSE;
        $arguments['reportCharset']               = isset($arguments['reportCharset'])               ? $arguments['reportCharset']               : 'UTF-8';
        $arguments['reportHighlight']             = isset($arguments['reportHighlight'])             ? $arguments['reportHighlight']             : FALSE;
        $arguments['reportHighLowerBound']        = isset($arguments['reportHighLowerBound'])        ? $arguments['reportHighLowerBound']        : 70;
        $arguments['reportLowUpperBound']         = isset($arguments['reportLowUpperBound'])         ? $arguments['reportLowUpperBound']         : 35;
        $arguments['reportYUI']                   = isset($arguments['reportYUI'])                   ? $arguments['reportYUI']                   : TRUE;
        $arguments['stopOnError']                 = isset($arguments['stopOnError'])                 ? $arguments['stopOnError']                 : FALSE;
        $arguments['stopOnFailure']               = isset($arguments['stopOnFailure'])               ? $arguments['stopOnFailure']               : FALSE;
        $arguments['stopOnIncomplete']            = isset($arguments['stopOnIncomplete'])            ? $arguments['stopOnIncomplete']            : FALSE;
        $arguments['stopOnSkipped']               = isset($arguments['stopOnSkipped'])               ? $arguments['stopOnSkipped']               : FALSE;
        $arguments['strict']                      = isset($arguments['strict'])                      ? $arguments['strict']                      : FALSE;
        $arguments['verbose']                     = isset($arguments['verbose'])                     ? $arguments['verbose']                     : FALSE;

        $this->codeCoverage->setCacheTokens($arguments['cacheTokens']);

        if ($arguments['filter'] !== FALSE &&
            preg_match('/^[a-zA-Z0-9_]/', $arguments['filter'])) {
            // Escape delimiters in regular expression. Do NOT use preg_quote,
            // to keep magic characters.
            $arguments['filter'] = '/' . str_replace(
              '/', '\\/', $arguments['filter']
            ) . '/';
        }
    }
開發者ID:necromant2005,項目名稱:phpunit,代碼行數:101,代碼來源:TestRunner.php


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