本文整理汇总了PHP中WP_UnitTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP WP_UnitTestCase类的具体用法?PHP WP_UnitTestCase怎么用?PHP WP_UnitTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WP_UnitTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: tearDown
function tearDown()
{
global $wp_rewrite;
$wp_rewrite->init();
update_option('home', $this->home_url);
parent::tearDown();
}
示例3: setUp
public function setUp()
{
if (!extension_loaded('openssl')) {
$this->markTestSkipped('Tests_HTTP_Functions requires openssl.');
}
parent::setUp();
}
示例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);
}
示例5: setUp
function setUp()
{
parent::setUp();
global $wp_rewrite;
$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
$wp_rewrite->flush_rules();
}
示例6: tearDown
function tearDown()
{
foreach (array('curl', 'streams', 'fsockopen') as $t) {
remove_filter("use_{$t}_transport", '__return_false');
}
parent::tearDown();
}
示例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();
}
示例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);
}
示例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'));
}
示例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');
}
示例11: tearDown
function tearDown()
{
global $wpdb;
update_site_option('ms_files_rewriting', 0);
$wpdb->suppress_errors($this->suppress);
parent::tearDown();
}
示例12: tearDown
public function tearDown()
{
// Restoring global variables
global $content_width;
$content_width = $this->_globals['content_width'];
parent::tearDown();
}
示例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'));
}
示例14: setUp
function setUp()
{
parent::setUp();
set_current_screen('edit-page');
$GLOBALS['hook_suffix'] = '';
$this->table = _get_list_table('WP_Posts_List_Table');
}
示例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')));
}