/** * This function is run before each method */ public function setUp() { parent::setUp(); $this->user = $this->factory->user->create(array('role' => 'administrator')); $this->editor = $this->factory->user->create(array('role' => 'editor', 'user_email' => '*****@*****.**')); $this->endpoint = new WP_REST_Users_Controller(); }
public function setUp() { parent::setUp(); $this->post_id = $this->factory->post->create(); $this->admin_id = $this->factory->user->create(array('role' => 'administrator')); $this->public_taxonomy_pages = 'pages_taxonomy'; register_taxonomy($this->public_taxonomy_pages, 'page'); }
public function setUp() { parent::setUp(); $this->endpoint = new WP_REST_Comments_Controller(); if (is_multisite()) { update_site_option('site_admins', array('superadmin')); } }
public function setUp() { parent::setUp(); $this->user = $this->factory->user->create(); wp_set_current_user($this->user); $this->user_obj = wp_get_current_user(); $this->user_obj->add_role('author'); }
public function setUp() { parent::setUp(); $revisions = wp_get_post_revisions(self::$post_id); $this->revision_1 = array_pop($revisions); $this->revision_id1 = $this->revision_1->ID; $this->revision_2 = array_pop($revisions); $this->revision_id2 = $this->revision_2->ID; }
public function setUp() { parent::setUp(); $this->administrator = $this->factory->user->create(array('role' => 'administrator')); $this->subscriber = $this->factory->user->create(array('role' => 'subscriber')); wp_set_current_user($this->administrator); $this->category_id = $this->factory->category->create(array('name' => 'Test Category')); $this->category_2_id = $this->factory->category->create(array('name' => 'Test Category 2')); }
public function setUp() { global $wp_version; if (version_compare($wp_version, '4.7-alpha', '<')) { return $this->markTestSkipped('WordPress version not supported.'); } parent::setUp(); $this->administrator = $this->factory->user->create(array('role' => 'administrator')); $this->endpoint = new WP_REST_Settings_Controller(); }
public function setUp() { parent::setUp(); $this->admin_id = $this->factory->user->create(array('role' => 'administrator')); $this->subscriber_id = $this->factory->user->create(array('role' => 'subscriber')); $this->author_id = $this->factory->user->create(array('role' => 'author')); $this->post_id = $this->factory->post->create(); $this->approved_id = $this->factory->comment->create(array('comment_approved' => 1, 'comment_post_ID' => $this->post_id, 'user_id' => 0)); $this->hold_id = $this->factory->comment->create(array('comment_approved' => 0, 'comment_post_ID' => $this->post_id, 'user_id' => $this->subscriber_id)); }
public function setUp() { parent::setUp(); $this->post_id = $this->factory->post->create(); $this->page_id = $this->factory->post->create(array('post_type' => 'page')); $this->editor_id = $this->factory->user->create(array('role' => 'editor')); $this->contributor_id = $this->factory->user->create(array('role' => 'contributor')); wp_update_post(array('post_content' => 'This content is better.', 'ID' => $this->post_id)); wp_update_post(array('post_content' => 'This content is marvelous.', 'ID' => $this->post_id)); $revisions = wp_get_post_revisions($this->post_id); $this->revision_1 = array_pop($revisions); $this->revision_id1 = $this->revision_1->ID; $this->revision_2 = array_pop($revisions); $this->revision_id2 = $this->revision_2->ID; }
public function setUp() { parent::setUp(); $this->endpoint = new WP_REST_Users_Controller(); }
public function setUp() { parent::setUp(); $this->administrator = $this->factory->user->create(array('role' => 'administrator')); $this->subscriber = $this->factory->user->create(array('role' => 'subscriber')); }
public function setUp() { parent::setUp(); Jetpack::load_xml_rpc_client(); }