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


PHP PHPUnit_Util_Getopt类代码示例

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


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

示例1: __construct

 /**
  * Parse the options to see if we are running the uninstall group.
  *
  * @since 0.1.0
  *
  * @param array $argv The commandline arguments.
  */
 public function __construct($argv)
 {
     array_shift($argv);
     $options = array();
     while (list($i, $arg) = each($argv)) {
         try {
             if (strlen($arg) > 1 && $arg[0] === '-' && $arg[1] === '-') {
                 PHPUnit_Util_Getopt::parseLongOption(substr($arg, 2), $this->longOptions, $options, $argv);
             }
         } catch (PHPUnit_Framework_Exception $e) {
             // Right now we don't really care what the arguments are like.
             continue;
         }
     }
     foreach ($options as $option) {
         switch ($option[0]) {
             case '--group':
                 $groups = explode(',', $option[1]);
                 $this->uninstall_group = in_array('uninstall', $groups);
                 break 2;
         }
     }
     if (!$this->uninstall_group) {
         echo 'Not running plugin install/uninstall tests... To execute these, use --group uninstall.' . PHP_EOL;
     }
 }
开发者ID:jdgrimes,项目名称:wp-plugin-uninstall-tester,代码行数:33,代码来源:wp-plugin-uninstall-tester-phpunit-util-getopt.php

示例2: testItIncludeTheShortOptionsAfterTheArgument

 public function testItIncludeTheShortOptionsAfterTheArgument()
 {
     $args = ['command', 'myArgument', '-v'];
     $actual = PHPUnit_Util_Getopt::getopt($args, 'v');
     $expected = [[['v', null]], ['myArgument']];
     $this->assertEquals($expected, $actual);
 }
开发者ID:phecho,项目名称:phpunit,代码行数:7,代码来源:GetoptTest.php

示例3: testItIncludeTheShortOptionsAfterTheArgument

 public function testItIncludeTheShortOptionsAfterTheArgument()
 {
     $args = array('command', 'myArgument', '-v');
     $actual = PHPUnit_Util_Getopt::getopt($args, 'v');
     $expected = array(array(array('v', null)), array('myArgument'));
     $this->assertEquals($expected, $actual);
 }
开发者ID:Ceciceciceci,项目名称:MySJSU-Class-Registration,代码行数:7,代码来源:GetoptTest.php

示例4: _get_test_suite

function _get_test_suite()
{
    $suite = '';
    $opts = PHPUnit_Util_Getopt::getopt($GLOBALS['argv'], 'd:c:hv', array('filter=', 'testsuite='));
    foreach ($opts[0] as $opt) {
        if ('--testsuite' === $opt[0]) {
            $suite = $opt[1];
            break;
        }
        if ('--filter' === $opt[0] && false !== stripos($opt[1], 'unit')) {
            $suite = 'unit';
            break;
        }
    }
    return strtolower($suite);
}
开发者ID:cedaro,项目名称:wprestcop,代码行数:16,代码来源:bootstrap.php

示例5: __construct

 function __construct($argv)
 {
     array_shift($argv);
     $options = array();
     while (list($i, $arg) = each($argv)) {
         try {
             if (strlen($arg) > 1 && $arg[0] === '-' && $arg[1] === '-') {
                 PHPUnit_Util_Getopt::parseLongOption(substr($arg, 2), $this->longOptions, $options, $argv);
             }
         } catch (PHPUnit_Framework_Exception $e) {
             // Enforcing recognized arguments or correctly formed arguments is
             // not really the concern here.
             continue;
         }
     }
     $ajax_message = true;
     foreach ($options as $option) {
         switch ($option[0]) {
             case '--exclude-group':
                 $ajax_message = false;
                 continue 2;
             case '--group':
                 $groups = explode(',', $option[1]);
                 foreach ($groups as $group) {
                     if (is_numeric($group) || preg_match('/^(UT|Plugin)\\d+$/', $group)) {
                         WP_UnitTestCase::forceTicket($group);
                     }
                 }
                 $ajax_message = !in_array('ajax', $groups);
                 continue 2;
         }
     }
     if ($ajax_message) {
         echo "Not running ajax tests... To execute these, use --group ajax." . PHP_EOL;
     }
 }
开发者ID:Bostonncity,项目名称:wp-browser,代码行数:36,代码来源:bootstrap.php

示例6: __construct

 function __construct($argv)
 {
     $options = PHPUnit_Util_Getopt::getopt($argv, 'd:c:hv', array_keys($this->longOptions));
     $ajax_message = true;
     foreach ($options[0] as $option) {
         switch ($option[0]) {
             case '--exclude-group':
                 $ajax_message = false;
                 continue 2;
             case '--group':
                 $groups = explode(',', $option[1]);
                 foreach ($groups as $group) {
                     if (is_numeric($group) || preg_match('/^(UT|Plugin)\\d+$/', $group)) {
                         WP_UnitTestCase::forceTicket($group);
                     }
                 }
                 $ajax_message = !in_array('ajax', $groups);
                 continue 2;
         }
     }
     if ($ajax_message) {
         echo "Not running ajax tests... To execute these, use --group ajax." . PHP_EOL;
     }
 }
开发者ID:amgxyz,项目名称:geocms-custom-maps,代码行数:24,代码来源:bootstrap.php

示例7: handleArguments

 /**
  * Handles the command-line arguments.
  *
  * A child class of PHPUnit_TextUI_Command can hook into the argument
  * parsing by adding the switch(es) to the $longOptions array and point to a
  * callback method that handles the switch(es) in the child class like this
  *
  * <code>
  * <?php
  * class MyCommand extends PHPUnit_TextUI_Command
  * {
  *     public function __construct()
  *     {
  *         // my-switch won't accept a value, it's an on/off
  *         $this->longOptions['my-switch'] = 'myHandler';
  *         // my-secondswitch will accept a value - note the equals sign
  *         $this->longOptions['my-secondswitch='] = 'myOtherHandler';
  *     }
  *
  *     // --my-switch  -> myHandler()
  *     protected function myHandler()
  *     {
  *     }
  *
  *     // --my-secondswitch foo -> myOtherHandler('foo')
  *     protected function myOtherHandler ($value)
  *     {
  *     }
  *
  *     // You will also need this - the static keyword in the
  *     // PHPUnit_TextUI_Command will mean that it'll be
  *     // PHPUnit_TextUI_Command that gets instantiated,
  *     // not MyCommand
  *     public static function main($exit = true)
  *     {
  *         $command = new static;
  *
  *         return $command->run($_SERVER['argv'], $exit);
  *     }
  *
  * }
  * </code>
  *
  * @param array $argv
  */
 protected function handleArguments(array $argv)
 {
     if (defined('__PHPUNIT_PHAR__')) {
         $this->longOptions['check-version'] = null;
         $this->longOptions['selfupdate'] = null;
         $this->longOptions['self-update'] = null;
         $this->longOptions['selfupgrade'] = null;
         $this->longOptions['self-upgrade'] = null;
     }
     try {
         $this->options = PHPUnit_Util_Getopt::getopt($argv, 'd:c:hv', array_keys($this->longOptions));
     } catch (PHPUnit_Framework_Exception $e) {
         $this->showError($e->getMessage());
     }
     foreach ($this->options[0] as $option) {
         switch ($option[0]) {
             case '--colors':
                 $this->arguments['colors'] = $option[1] ?: PHPUnit_TextUI_ResultPrinter::COLOR_AUTO;
                 break;
             case '--bootstrap':
                 $this->arguments['bootstrap'] = $option[1];
                 break;
             case '--columns':
                 if (is_numeric($option[1])) {
                     $this->arguments['columns'] = (int) $option[1];
                 } elseif ($option[1] == 'max') {
                     $this->arguments['columns'] = 'max';
                 }
                 break;
             case 'c':
             case '--configuration':
                 $this->arguments['configuration'] = $option[1];
                 break;
             case '--coverage-clover':
                 $this->arguments['coverageClover'] = $option[1];
                 break;
             case '--coverage-crap4j':
                 $this->arguments['coverageCrap4J'] = $option[1];
                 break;
             case '--coverage-html':
                 $this->arguments['coverageHtml'] = $option[1];
                 break;
             case '--coverage-php':
                 $this->arguments['coveragePHP'] = $option[1];
                 break;
             case '--coverage-text':
                 if ($option[1] === null) {
                     $option[1] = 'php://stdout';
                 }
                 $this->arguments['coverageText'] = $option[1];
                 $this->arguments['coverageTextShowUncoveredFiles'] = false;
                 $this->arguments['coverageTextShowOnlySummary'] = false;
                 break;
             case '--coverage-xml':
                 $this->arguments['coverageXml'] = $option[1];
//.........这里部分代码省略.........
开发者ID:tangyu,项目名称:phpunit,代码行数:101,代码来源:Command.php

示例8: 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

示例9: handleArguments

 /**
  */
 protected static function handleArguments()
 {
     $arguments = array('listGroups' => FALSE, 'syntaxCheck' => TRUE);
     $longOptions = array('ansi', 'bootstrap=', 'configuration=', 'coverage-html=', 'coverage-clover=', 'coverage-source=', 'coverage-xml=', 'exclude-group=', 'filter=', 'group=', 'help', 'list-groups', 'loader=', 'log-graphviz=', 'log-json=', 'log-metrics=', 'log-pmd=', 'log-tap=', 'log-xml=', 'repeat=', 'report=', 'skeleton', 'skeleton-class', 'skeleton-test', 'stop-on-failure', 'story', 'story-html=', 'story-text=', 'tap', 'test-db-dsn=', 'test-db-log-rev=', 'test-db-log-prefix=', 'test-db-log-info=', 'testdox', 'testdox-html=', 'testdox-text=', 'no-syntax-check', 'verbose', 'version', 'wait');
     try {
         $options = PHPUnit_Util_Getopt::getopt($_SERVER['argv'], 'd:', $longOptions);
     } catch (RuntimeException $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
     if (isset($options[1][0])) {
         $arguments['test'] = $options[1][0];
     }
     if (isset($options[1][1])) {
         $arguments['testFile'] = $options[1][1];
     } else {
         $arguments['testFile'] = '';
     }
     foreach ($options[0] as $option) {
         switch ($option[0]) {
             case '--ansi':
                 $arguments['ansi'] = TRUE;
                 break;
             case '--bootstrap':
                 $arguments['bootstrap'] = $option[1];
                 break;
             case '--configuration':
                 $arguments['configuration'] = $option[1];
                 break;
             case '--coverage-clover':
             case '--coverage-xml':
                 if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
                     $arguments['coverageClover'] = $option[1];
                 } else {
                     if (!extension_loaded('tokenizer')) {
                         self::showMissingDependency('The tokenizer extension is not loaded.');
                     } else {
                         self::showMissingDependency('The Xdebug extension is not loaded.');
                     }
                 }
                 break;
             case '--coverage-source':
                 if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
                     $arguments['coverageSource'] = $option[1];
                 } else {
                     if (!extension_loaded('tokenizer')) {
                         self::showMissingDependency('The tokenizer extension is not loaded.');
                     } else {
                         self::showMissingDependency('The Xdebug extension is not loaded.');
                     }
                 }
                 break;
             case '--coverage-html':
             case '--report':
                 if (extension_loaded('tokenizer') && extension_loaded('xdebug')) {
                     $arguments['reportDirectory'] = $option[1];
                 } else {
                     if (!extension_loaded('tokenizer')) {
                         self::showMissingDependency('The tokenizer extension is not loaded.');
                     } else {
                         self::showMissingDependency('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 '--help':
                 self::showHelp();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--filter':
                 if (preg_match('/^[a-zA-Z0-9_]/', $option[1])) {
                     $arguments['filter'] = '/' . $option[1] . '/';
                 } else {
                     $arguments['filter'] = $option[1];
                 }
                 break;
             case '--group':
                 $arguments['groups'] = explode(',', $option[1]);
                 break;
             case '--exclude-group':
                 $arguments['excludeGroups'] = explode(',', $option[1]);
                 break;
             case '--list-groups':
                 $arguments['listGroups'] = TRUE;
                 break;
             case '--loader':
                 self::handleLoader($option[1]);
                 break;
             case '--log-json':
                 $arguments['jsonLogfile'] = $option[1];
//.........这里部分代码省略.........
开发者ID:xiplias,项目名称:pails,代码行数:101,代码来源:Command.php

示例10: handleArguments

 /**
  * Handles the command-line arguments.
  *
  * A child class of PHPUnit_TextUI_Command can hook into the argument
  * parsing by adding the switch(es) to the $longOptions array and point to a
  * callback method that handles the switch(es) in the child class like this
  *
  * <code>
  * <?php
  * class MyCommand extends PHPUnit_TextUI_Command
  * {
  *     public function __construct()
  *     {
  *         // my-switch won't accept a value, it's an on/off
  *         $this->longOptions['my-switch'] = 'myHandler';
  *         // my-secondswitch will accept a value - note the equals sign
  *         $this->longOptions['my-secondswitch='] = 'myOtherHandler';
  *     }
  *
  *     // --my-switch  -> myHandler()
  *     protected function myHandler()
  *     {
  *     }
  *
  *     // --my-secondswitch foo -> myOtherHandler('foo')
  *     protected function myOtherHandler ($value)
  *     {
  *     }
  *
  *     // You will also need this - the static keyword in the
  *     // PHPUnit_TextUI_Command will mean that it'll be
  *     // PHPUnit_TextUI_Command that gets instantiated,
  *     // not MyCommand
  *     public static function main($exit = true)
  *     {
  *         $command = new static;
  *
  *         return $command->run($_SERVER['argv'], $exit);
  *     }
  *
  * }
  * </code>
  *
  * @param array $argv
  */
 protected function handleArguments(array $argv)
 {
     if (defined('__PHPUNIT_PHAR__')) {
         $this->longOptions['selfupdate'] = null;
         $this->longOptions['self-update'] = null;
     }
     try {
         $this->options = PHPUnit_Util_Getopt::getopt($argv, 'd:c:hv', array_keys($this->longOptions));
     } catch (PHPUnit_Framework_Exception $e) {
         $this->showError($e->getMessage());
     }
     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 '--columns':
                 if (is_numeric($option[1])) {
                     $this->arguments['columns'] = (int) $option[1];
                 } elseif ($option[1] == 'max') {
                     $this->arguments['columns'] = 'max';
                 }
                 break;
             case 'c':
             case '--configuration':
                 $this->arguments['configuration'] = $option[1];
                 break;
             case '--coverage-clover':
                 $this->arguments['coverageClover'] = $option[1];
                 break;
             case '--coverage-crap4j':
                 $this->arguments['coverageCrap4J'] = $option[1];
                 break;
             case '--coverage-html':
                 $this->arguments['coverageHtml'] = $option[1];
                 break;
             case '--coverage-php':
                 $this->arguments['coveragePHP'] = $option[1];
                 break;
             case '--coverage-text':
                 if ($option[1] === null) {
                     $option[1] = 'php://stdout';
                 }
                 $this->arguments['coverageText'] = $option[1];
                 $this->arguments['coverageTextShowUncoveredFiles'] = false;
                 $this->arguments['coverageTextShowOnlySummary'] = false;
                 break;
             case '--coverage-xml':
                 $this->arguments['coverageXml'] = $option[1];
                 break;
             case 'd':
                 $ini = explode('=', $option[1]);
//.........这里部分代码省略.........
开发者ID:HarveyCheng,项目名称:myblog,代码行数:101,代码来源:Command.php

示例11: handleArguments

 /**
  * @access protected
  * @static
  */
 protected static function handleArguments()
 {
     $arguments = array('syntaxCheck' => TRUE);
     $longOptions = array('configuration=', 'exclude-group=', 'filter=', 'group=', 'help', 'loader=', 'log-json=', 'log-tap=', 'log-xml=', 'repeat=', 'skeleton', 'stop-on-failure', 'tap', 'testdox', 'testdox-html=', 'testdox-text=', 'no-syntax-check', 'verbose', 'version', 'wait');
     if (class_exists('Image_GraphViz', FALSE)) {
         $longOptions[] = 'log-graphviz=';
     }
     if (extension_loaded('pdo')) {
         $longOptions[] = 'test-db-dsn=';
         $longOptions[] = 'test-db-log-rev=';
         $longOptions[] = 'test-db-log-prefix=';
         $longOptions[] = 'test-db-log-info=';
     }
     if (extension_loaded('xdebug')) {
         $longOptions[] = 'coverage-html=';
         $longOptions[] = 'coverage-xml=';
         $longOptions[] = 'log-metrics=';
         $longOptions[] = 'log-pmd=';
         $longOptions[] = 'report=';
     }
     try {
         $options = PHPUnit_Util_Getopt::getopt($_SERVER['argv'], 'd:', $longOptions);
     } catch (RuntimeException $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
     if (isset($options[1][0])) {
         $arguments['test'] = $options[1][0];
     }
     if (isset($options[1][1])) {
         $arguments['testFile'] = $options[1][1];
     } else {
         $arguments['testFile'] = '';
     }
     foreach ($options[0] as $option) {
         switch ($option[0]) {
             case '--configuration':
                 $arguments['configuration'] = $option[1];
                 break;
             case '--coverage-xml':
                 $arguments['coverageXML'] = $option[1];
                 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 '--help':
                 self::showHelp();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--filter':
                 if (preg_match('/^[a-zA-Z0-9_]/', $option[1])) {
                     $arguments['filter'] = '/^' . $option[1] . '$/';
                 } else {
                     $arguments['filter'] = $option[1];
                 }
                 break;
             case '--group':
                 $arguments['groups'] = explode(',', $option[1]);
                 break;
             case '--exclude-group':
                 $arguments['excludeGroups'] = explode(',', $option[1]);
                 break;
             case '--loader':
                 self::handleLoader($option[1]);
                 break;
             case '--log-json':
                 $arguments['jsonLogfile'] = $option[1];
                 break;
             case '--log-graphviz':
                 $arguments['graphvizLogfile'] = $option[1];
                 break;
             case '--log-tap':
                 $arguments['tapLogfile'] = $option[1];
                 break;
             case '--log-xml':
                 $arguments['xmlLogfile'] = $option[1];
                 break;
             case '--log-pmd':
                 $arguments['pmdXML'] = $option[1];
                 break;
             case '--log-metrics':
                 $arguments['metricsXML'] = $option[1];
                 break;
             case '--repeat':
                 $arguments['repeat'] = (int) $option[1];
                 break;
             case '--stop-on-failure':
                 $arguments['stopOnFailure'] = TRUE;
                 break;
             case '--test-db-dsn':
//.........这里部分代码省略.........
开发者ID:ahmedadham88,项目名称:enhanced-social-network,代码行数:101,代码来源:Command.php

示例12: __construct

 function __construct($argv)
 {
     array_shift($argv);
     $options = array();
     while (list($i, $arg) = each($argv)) {
         try {
             if (strlen($arg) > 1 && $arg[0] === '-' && $arg[1] === '-') {
                 PHPUnit_Util_Getopt::parseLongOption(substr($arg, 2), $this->longOptions, $options, $argv);
             }
         } catch (PHPUnit_Framework_Exception $e) {
             // Enforcing recognized arguments or correctly formed arguments is
             // not really the concern here.
             continue;
         }
     }
     $skipped_groups = array('ajax' => true, 'ms-files' => true, 'external-http' => true);
     foreach ($options as $option) {
         switch ($option[0]) {
             case '--exclude-group':
                 foreach ($skipped_groups as $group_name => $skipped) {
                     $skipped_groups[$group_name] = false;
                 }
                 continue 2;
             case '--group':
                 $groups = explode(',', $option[1]);
                 foreach ($groups as $group) {
                     if (is_numeric($group) || preg_match('/^(UT|Plugin)\\d+$/', $group)) {
                         WP_UnitTestCase::forceTicket($group);
                     }
                 }
                 foreach ($skipped_groups as $group_name => $skipped) {
                     if (in_array($group_name, $groups)) {
                         $skipped_groups[$group_name] = false;
                     }
                 }
                 continue 2;
         }
     }
     $skipped_groups = array_filter($skipped_groups);
     foreach ($skipped_groups as $group_name => $skipped) {
         echo sprintf('Not running %1$s tests. To execute these, use --group %1$s.', $group_name) . PHP_EOL;
     }
     if (!isset($skipped_groups['external-http'])) {
         echo PHP_EOL;
         echo 'External HTTP skipped tests can be caused by timeouts.' . PHP_EOL;
         echo 'If this changeset includes changes to HTTP, make sure there are no timeouts.' . PHP_EOL;
         echo PHP_EOL;
     }
 }
开发者ID:jaspermdegroot,项目名称:develop.wordpress,代码行数:49,代码来源:bootstrap.php

示例13: _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

示例14: 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

示例15: handleArguments

 /**
  * Handles the command-line arguments.
  *
  * A child class of PHPUnit_TextUI_Command can hook into the argument
  * parsing by adding the switch(es) to the $longOptions array and point to a
  * callback method that handles the switch(es) in the child class like this
  *
  * <code>
  * <?php
  * class MyCommand extends PHPUnit_TextUI_Command
  * {
  *     public function __construct()
  *     {
  *         $this->longOptions['--my-switch'] = 'myHandler';
  *     }
  *
  *     // --my-switch foo -> myHandler('foo')
  *     protected function myHandler($value)
  *     {
  *     }
  * }
  * </code>
  *
  * @param array $argv
  */
 protected function handleArguments(array $argv)
 {
     try {
         $this->options = PHPUnit_Util_Getopt::getopt($argv, 'd:c:hv', array_keys($this->longOptions));
     } catch (PHPUnit_Framework_Exception $e) {
         PHPUnit_TextUI_TestRunner::showError($e->getMessage());
     }
     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':
             case '--coverage-html':
             case '--coverage-php':
             case '--coverage-text':
                 if (!extension_loaded('tokenizer')) {
                     $this->showExtensionNotLoadedMessage('tokenizer', 'No code coverage will be generated.');
                     continue;
                 }
                 if (!extension_loaded('xdebug')) {
                     $this->showExtensionNotLoadedMessage('Xdebug', 'No code coverage will be generated.');
                     continue;
                 }
                 switch ($option[0]) {
                     case '--coverage-clover':
                         $this->arguments['coverageClover'] = $option[1];
                         break;
                     case '--coverage-html':
                         $this->arguments['reportDirectory'] = $option[1];
                         break;
                     case '--coverage-php':
                         $this->arguments['coveragePHP'] = $option[1];
                         break;
                     case '--coverage-text':
                         if ($option[1] === NULL) {
                             $option[1] = 'php://stdout';
                         }
                         $this->arguments['coverageText'] = $option[1];
                         $this->arguments['coverageTextShowUncoveredFiles'] = FALSE;
                         break;
                 }
                 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 'h':
             case '--help':
                 $this->showHelp();
                 exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
                 break;
             case '--filter':
                 $this->arguments['filter'] = $option[1];
                 break;
             case '--group':
                 $this->arguments['groups'] = explode(',', $option[1]);
                 break;
             case '--exclude-group':
//.........这里部分代码省略.........
开发者ID:rtwo,项目名称:phpunit,代码行数:101,代码来源:Command.php


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