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


PHP WP_UnitTestCase::forceTicket方法代码示例

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


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

示例1: __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

示例2: __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:jakejackson1,项目名称:gravityflow,代码行数:24,代码来源:bootstrap.php

示例3: __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:staylor,项目名称:develop.svn.wordpress.org,代码行数:37,代码来源:bootstrap.php


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