本文整理汇总了PHP中WP_UnitTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP WP_UnitTestCase类的具体用法?PHP WP_UnitTestCase怎么用?PHP WP_UnitTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WP_UnitTestCase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
global $post;
parent::setUp();
$post = $this->factory->post->create_and_get();
$this->post = new WordPress_GitHub_Sync_Post($post->ID);
}
开发者ID:kilbot,项目名称:wordpress-github-sync,代码行数:7,代码来源:test-helpers.php
示例2: tearDown
function tearDown()
{
global $wp_rewrite;
$wp_rewrite->init();
update_option('home', $this->home_url);
parent::tearDown();
}
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:7,代码来源:rewrite.php
示例3: setUp
public function setUp()
{
if (!extension_loaded('openssl')) {
$this->markTestSkipped('Tests_HTTP_Functions requires openssl.');
}
parent::setUp();
}
开发者ID:rclilly,项目名称:wordpress-develop,代码行数:7,代码来源:functions.php
示例4: setUp
public function setUp()
{
parent::setUp();
$this->author_id = self::factory()->user->create(array('role' => 'editor'));
// Override the post/archive slug collision prevention in `wp_unique_post_slug()`.
add_filter('wp_unique_post_slug', array($this, 'filter_unique_post_slug'), 10, 6);
}
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:7,代码来源:numericSlugs.php
示例5: setUp
function setUp()
{
parent::setUp();
global $wp_rewrite;
$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
$wp_rewrite->flush_rules();
}
开发者ID:boonebgorges,项目名称:wp,代码行数:7,代码来源:gallery.php
示例6: tearDown
function tearDown()
{
foreach (array('curl', 'streams', 'fsockopen') as $t) {
remove_filter("use_{$t}_transport", '__return_false');
}
parent::tearDown();
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:7,代码来源:base.php
示例7: tearDown
function tearDown()
{
remove_filter('extra_theme_headers', array($this, '_theme_data_extra_headers'));
wp_clean_themes_cache();
unset($GLOBALS['wp_themes']);
parent::tearDown();
}
开发者ID:Benrajalu,项目名称:philRaj,代码行数:7,代码来源:theme.php
示例8: setUp
function setUp()
{
parent::setUp();
global $rcp_levels_db;
$args = array('name' => 'Gold', 'description' => 'The Gold Plan', 'duration' => '1', 'duration_unit' => 'month', 'price' => '10', 'fee' => '0', 'list_order' => '0', 'level' => '5', 'status' => 'active', 'role' => 'subscriber');
$this->_level_id = $rcp_levels_db->insert($args);
}
开发者ID:ramiy,项目名称:restrict-content-pro,代码行数:7,代码来源:test-levels.php
示例9: setUp
function setUp()
{
parent::setUp();
$this->month_url = get_month_link(date('Y'), date('m'));
$this->year_url = get_year_link(date('Y'));
$this->post_ids = $this->factory->post->create_many(8, array('post_type' => 'post', 'post_author' => '1'));
}
开发者ID:boonebgorges,项目名称:wp,代码行数:7,代码来源:getArchives.php
示例10: setUp
function setUp()
{
parent::setUp();
$this->container = new Container();
$this->container->object('pluginMeta', array())->packager('cliPackager', 'Arrow\\Twig\\CliPackager');
$this->packager = $this->container->lookup('cliPackager');
}
开发者ID:dsawardekar,项目名称:arrow,代码行数:7,代码来源:CliPackagerTest.php
示例11: tearDown
function tearDown()
{
global $wpdb;
update_site_option('ms_files_rewriting', 0);
$wpdb->suppress_errors($this->suppress);
parent::tearDown();
}
开发者ID:Benrajalu,项目名称:philRaj,代码行数:7,代码来源:ms-files-rewriting.php
示例12: tearDown
public function tearDown()
{
// Restoring global variables
global $content_width;
$content_width = $this->_globals['content_width'];
parent::tearDown();
}
开发者ID:dacker,项目名称:jetpack,代码行数:7,代码来源:test_class.jetpack_photon.php
示例13: tearDown
/**
* Finish the test suite for the CASServerPlugin class.
*/
function tearDown()
{
parent::tearDown();
unset($this->server);
unset($this->redirect_location);
remove_filter('wp_redirect', array($this, 'wp_redirect_handler'));
}
开发者ID:goblindegook,项目名称:wp-cas-server,代码行数:10,代码来源:FiltersTest.php
示例14: setUp
function setUp()
{
parent::setUp();
set_current_screen('edit-page');
$GLOBALS['hook_suffix'] = '';
$this->table = _get_list_table('WP_Posts_List_Table');
}
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:7,代码来源:includesListTable.php
示例15: setUp
function setUp()
{
parent::setUp();
$this->noop = new NOOP_Translations();
$this->entry = new Translation_Entry(array('singular' => 'baba'));
$this->plural_entry = new Translation_Entry(array('singular' => 'dyado', 'plural' => 'dyados', 'translations' => array('dyadox', 'dyadoy')));
}
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:7,代码来源:noopTranslations.php
示例16: assertPreConditions
function assertPreConditions()
{
parent::assertPreConditions();
// Reinit some of the globals that might have been cleared by BP_UnitTestCase::clean_up_global_scope().
// This is here because it didn't work in clean_up_global_scope(); I don't know why.
do_action('bp_setup_globals');
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:7,代码来源:testcase.php
示例17: setUp
/**
* Parse the file to get the exported data before the first test.
*/
public function setUp()
{
parent::setUp();
if (!$this->export_data) {
$this->parse_file();
}
}
开发者ID:lkwdwrd,项目名称:phpdoc-parser,代码行数:10,代码来源:export-testcase.php
示例18: setUp
function setUp()
{
parent::setUp();
$this->ticket_data = array('post_title' => 'Test Ticket', 'post_name' => 'Test Ticket', 'post_author' => 1, 'post_content' => 'In hac habitasse platea dictumst. Nulla neque dolor, sagittis eget, iaculis quis, molestie non, velit. Nullam cursus lacinia erat. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Donec vitae orci sed dolor rutrum auctor.');
$this->reply_data = array('post_content' => 'Vivamus aliquet elit ac nisl. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. Nullam dictum felis eu pede mollis pretium. Nullam vel sem. Praesent nonummy mi in odio.');
update_user_meta(1, 'wpas_can_be_assigned', 'yes');
}
开发者ID:f4bsch,项目名称:Awesome-Support,代码行数:7,代码来源:test-post.php
示例19: tearDown
/**
* Break down for next test
*/
function tearDown()
{
global $wp_rewrite;
$wp_rewrite->set_permalink_structure('');
_destroy_uploads();
parent::tearDown();
}
开发者ID:Beelegumes,项目名称:syst-ass-web,代码行数:10,代码来源:test_document_rewrites.php
示例20: tearDown
public function tearDown()
{
parent::tearDown();
$_SERVER['HTTP_REFERER'] = '';
$_SERVER['REQUEST_URI'] = '';
$_REQUEST['_wp_http_referer'] = '';
}
开发者ID:dd32,项目名称:wordpress.develop,代码行数:7,代码来源:referer.php
注:本文中的WP_UnitTestCase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论