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


PHP PHPUnit_TextUI_TestRunner::showError方法代码示例

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


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

示例1: handleBootstrap

 /**
  * Loads a bootstrap file.
  *
  * @param  string  $filename
  * @param  boolean $syntaxCheck
  * @see PHPUnit_TextUI_Command::handleBootstrap()
  * @since Method available since Release 2.16.0
  */
 protected function handleBootstrap($filename, $syntaxCheck = false)
 {
     try {
         PHPUnit_Util_Fileloader::checkAndLoad($filename, $syntaxCheck);
     } catch (RuntimeException $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
 }
开发者ID:nojimage,项目名称:stagehand-testrunner,代码行数:16,代码来源:PHPUnitPreparator.php

示例2: handleLoader

 /**
  * Handles the loading of the PHPUnit_Runner_TestSuiteLoader implementation.
  *
  * @param  string  $loaderClass
  * @param  string  $loaderFile
  */
 protected function handleLoader($loaderClass, $loaderFile = '')
 {
     if (!class_exists($loaderClass, FALSE)) {
         if ($loaderFile == '') {
             $loaderFile = PHPUnit_Util_Filesystem::classNameToFilename($loaderClass);
         }
         $loaderFile = PHPUnit_Util_Filesystem::fileExistsInIncludePath($loaderFile);
         if ($loaderFile !== FALSE) {
             require $loaderFile;
         }
     }
     if (class_exists($loaderClass, FALSE)) {
         $class = new ReflectionClass($loaderClass);
         if ($class->implementsInterface('PHPUnit_Runner_TestSuiteLoader') && $class->isInstantiable()) {
             $loader = $class->newInstance();
         }
     }
     if (!isset($loader)) {
         PHPUnit_TextUI_TestRunner::showError(sprintf('Could not use "%s" as loader.', $loaderClass));
     }
     return $loader;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:28,代码来源:Command.php

示例3: handleBootstrap

 /**
  * Loads a bootstrap file.
  *
  * @param string $filename
  */
 protected function handleBootstrap($filename)
 {
     try {
         PHPUnit_Util_Fileloader::checkAndLoad($filename);
     } catch (PHPUnit_Framework_Exception $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
 }
开发者ID:rtwo,项目名称:phpunit,代码行数:13,代码来源:Command.php

示例4: handleArguments

    /**
     * This function is cut&paste from PHPUnit_TextUI_Command::handleArguments
     * Removed the need for a required unnamed command option ( 'test')
     **/
    protected function handleArguments(array $argv)
    {
        try {
            $this->options = PHPUnit_Util_Getopt::getopt(
              $argv,
              'd:c:',
              array_keys($this->longOptions)
            );
        }

        catch (RuntimeException $e) {
            PHPUnit_TextUI_TestRunner::showError($e->getMessage());
        }

        $skeletonClass = FALSE;
        $skeletonTest  = FALSE;

        foreach ($this->options[0] as $option) {
            switch ($option[0]) {
                case '--colors': {
                    $this->arguments['colors'] = TRUE;
                }
                break;

                case '--bootstrap': {
                    $this->arguments['bootstrap'] = $option[1];
                }
                break;

                case 'c':
                case '--configuration': {
                    $this->arguments['configuration'] = $option[1];
                }
                break;

                case '--coverage-clover': {
                    if (extension_loaded('tokenizer') &&
                        extension_loaded('xdebug')) {
                        $this->arguments['coverageClover'] = $option[1];
                    } else {
                        if (!extension_loaded('tokenizer')) {
                            $this->showMessage(
                              'The tokenizer extension is not loaded.'
                            );
                        } else {
                            $this->showMessage(
                              'The Xdebug extension is not loaded.'
                            );
                        }
                    }
                }
                break;

                case '--coverage-html': {
                    if (extension_loaded('tokenizer') &&
                        extension_loaded('xdebug')) {
                        $this->arguments['reportDirectory'] = $option[1];
                    } else {
                        if (!extension_loaded('tokenizer')) {
                            $this->showMessage(
                              'The tokenizer extension is not loaded.'
                            );
                        } else {
                            $this->showMessage(
                              'The Xdebug extension is not loaded.'
                            );
                        }
                    }
                }
                break;

                case 'd': {
                    $ini = explode('=', $option[1]);

                    if (isset($ini[0])) {
                        if (isset($ini[1])) {
                            ini_set($ini[0], $ini[1]);
                        } else {
                            ini_set($ini[0], TRUE);
                        }
                    }
                }
                break;

                case '--debug': {
                    $this->arguments['debug'] = TRUE;
                }
                break;

                case '--help': {
                    $this->showHelp();
                    exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                }
                break;

                case '--filter': {
//.........这里部分代码省略.........
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:101,代码来源:ezptestrunner.php

示例5: handleLoader

 /**
  * @param  string  $loaderName
  */
 protected static function handleLoader($loaderName)
 {
     if (!class_exists($loaderName, FALSE)) {
         PHPUnit_Util_Fileloader::checkAndLoad(str_replace('_', '/', $loaderName) . '.php');
     }
     if (class_exists($loaderName, FALSE)) {
         $class = new ReflectionClass($loaderName);
         if ($class->implementsInterface('PHPUnit_Runner_TestSuiteLoader') && $class->isInstantiable()) {
             $loader = $class->newInstance();
         }
     }
     if (!isset($loader)) {
         PHPUnit_TextUI_TestRunner::showError(sprintf('Could not use "%s" as loader.', $loaderName));
     }
     PHPUnit_TextUI_TestRunner::setLoader($loader);
 }
开发者ID:xiplias,项目名称:pails,代码行数:19,代码来源:Command.php

示例6: createCodeCoverageFilter

 /**
  * Whitelists all kernel, lib and extension classes for code coverage
  *
  * @return PHP_CodeCoverage_Filter
  */
 protected function createCodeCoverageFilter()
 {
     $filter = new PHP_CodeCoverage_Filter();
     // Add kernel classes to whitelist
     $kernelClassFiles = (require 'autoload/ezp_kernel.php');
     $filter->addFilesToWhitelist($kernelClassFiles);
     // Add extension classes to whitelist
     if (!is_file('var/autoload/ezp_extension.php')) {
         PHPUnit_TextUI_TestRunner::showError("Please generate the extension autoloads first.\n" . "You can generate them using php bin/php/ezpgenerateautoloads.php -e");
     }
     $extensionClassFiles = (require 'var/autoload/ezp_extension.php');
     $filter->addFilesToWhitelist($extensionClassFiles);
     return $filter;
 }
开发者ID:schwabokaner,项目名称:ezpublish-legacy,代码行数:19,代码来源:ezptestrunner.php

示例7: processCommandlineOptions

 /**
  * Handles the commandline arguments passed.
  * 
  * @return     array the commandline arguments
  * 
  * @author     Felix Gilcher <felix.gilcher@bitextender.com>
  * @since      1.0.0
  */
 public static function processCommandlineOptions()
 {
     $longOptions = array('coverage-html=', 'coverage-clover=', 'coverage-source=', 'coverage-xml=', 'report=', 'environment=', 'help', 'log-graphviz=', 'log-json=', 'log-metrics=', 'log-pmd=', 'log-tap=', 'log-xml=', 'include-suite=', 'exclude-suite=');
     try {
         $options = PHPUnit_Util_Getopt::getopt($_SERVER['argv'], 'd:', $longOptions);
     } catch (RuntimeException $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
     $arguments = array();
     foreach ($options[0] as $option) {
         switch ($option[0]) {
             case '--coverage-clover':
             case '--coverage-xml':
                 if (self::checkCodeCoverageDeps()) {
                     $arguments['coverageClover'] = $option[1];
                 }
                 break;
             case '--coverage-source':
                 if (self::checkCodeCoverageDeps()) {
                     $arguments['coverageSource'] = $option[1];
                 }
                 break;
             case '--coverage-html':
             case '--report':
                 if (self::checkCodeCoverageDeps()) {
                     $arguments['reportDirectory'] = $option[1];
                 }
                 break;
             case '--environment':
                 $arguments['environment'] = $option[1];
                 break;
             case '--help':
                 self::showHelp();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--log-json':
                 $arguments['jsonLogfile'] = $option[1];
                 break;
             case '--log-graphviz':
                 if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('Image/GraphViz.php')) {
                     $arguments['graphvizLogfile'] = $option[1];
                 } else {
                     throw new AgaviException('The Image_GraphViz package is not installed.');
                 }
                 break;
             case '--log-tap':
                 $arguments['tapLogfile'] = $option[1];
                 break;
             case '--log-xml':
                 $arguments['xmlLogfile'] = $option[1];
                 break;
             case '--log-pmd':
                 if (self::checkCodeCoverageDeps()) {
                     $arguments['pmdXML'] = $option[1];
                 }
                 break;
             case '--log-metrics':
                 if (self::checkCodeCoverageDeps()) {
                     $arguments['metricsXML'] = $option[1];
                 }
                 break;
             case '--include-suite':
                 $arguments['include-suite'] = $option[1];
                 break;
             case '--exclude-suite':
                 $arguments['exclude-suite'] = $option[1];
                 break;
         }
     }
     return $arguments;
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:79,代码来源:AgaviTesting.class.php

示例8: readOptions

 /**
  * Read PHPUnit options
  */
 protected function readOptions()
 {
     try {
         $reader = new Core_FileReader();
         $options = \PHPUnit_Util_Getopt::getopt($_SERVER['argv'], 'd:c:hv', array_keys($reader->getLongOptions()));
     } catch (\PHPUnit_Framework_Exception $e) {
         \PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
     foreach ($options[0] as $option) {
         $this->options[$option[0]] = isset($option[1]) ? $option[1] : true;
     }
 }
开发者ID:razielsd,项目名称:parallel-phpunit2,代码行数:15,代码来源:Runner.php

示例9: _initArguments

 /**
  * @access protected
  * @static
  */
 protected static function _initArguments()
 {
     $arguments['suite_filter'] = array();
     $arguments['runner_parameters'] = array();
     $longOptions = array('list-suites', 'new-suite=', 'suite-filter=', 'test-filter=', 'help', 'verbose', 'version');
     try {
         $options = PHPUnit_Util_Getopt::getopt($_SERVER['argv'], 'd:', $longOptions);
     } catch (RuntimeException $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
     foreach ($options[0] as $option) {
         switch ($option[0]) {
             case 'd':
                 $ini = explode('=', $option[1]);
                 if (isset($ini[0])) {
                     if (isset($ini[1])) {
                         ini_set($ini[0], $ini[1]);
                     } else {
                         ini_set($ini[0], TRUE);
                     }
                 }
                 break;
             case '--list-suites':
                 self::_listSuites();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--new-suite':
                 self::_createNewSuite($option[1]);
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--suite-filter':
                 $arguments['suite_filter'] = explode(",", $option[1]);
                 break;
             case '--test-filter':
                 $arguments['runner_parameters']['filter'] = "/" . $option[1] . "/i";
                 break;
             case '--help':
                 self::_showHelp();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--verbose':
                 $arguments['runner_parameters']['verbose'] = true;
                 break;
             case '--version':
                 self::_printVersionString();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
         }
     }
     self::$_arguments = $arguments;
     return true;
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:56,代码来源:ZFTestManager.php


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