function setUp() { parent::setUp(); $this->post_date_ts = strtotime('+1 day'); $this->post_data = array('post_type' => 'page', 'post_title' => rand_str(), 'post_content' => rand_str(2000), 'post_excerpt' => rand_str(100), 'post_author' => $this->make_user_by_role('author'), 'post_date' => strftime("%Y-%m-%d %H:%M:%S", $this->post_date_ts)); $this->post_id = wp_insert_post($this->post_data); }
function setUp() { parent::setUp(); $this->parent_term = wp_insert_term('parent' . rand_str(), 'category'); $this->assertInternalType('array', $this->parent_term); $this->parent_term = $this->parent_term['term_id']; }
function tearDown() { if (is_multisite()) { revoke_super_admin($this->administrator_id); } parent::tearDown(); }
function setUp() { parent::setUp(); $this->post_id = $this->factory->post->create(); $this->parent_comment_data = array('comment_post_ID' => $this->post_id, 'comment_author' => 'Test commenter', 'comment_author_url' => 'http://example.com/', 'comment_author_email' => '*****@*****.**', 'comment_content' => rand_str(100)); $this->parent_comment_id = wp_insert_comment($this->parent_comment_data); $this->child_comment_data = array('comment_post_ID' => $this->post_id, 'comment_author' => 'Test commenter 2', 'comment_author_url' => 'http://example.org/', 'comment_author_email' => '*****@*****.**', 'comment_parent' => $this->parent_comment_id, 'comment_content' => rand_str(100)); $this->child_comment_id = wp_insert_comment($this->child_comment_data); }
function setUp() { parent::setUp(); $this->post_date_ts = strtotime('+1 day'); $this->post_data = array('post_title' => rand_str(), 'post_content' => rand_str(2000), 'post_excerpt' => rand_str(100), 'post_author' => $this->make_user_by_role('author'), 'post_date' => strftime("%Y-%m-%d %H:%M:%S", $this->post_date_ts)); $this->post_id = wp_insert_post($this->post_data); $this->post_custom_field = array('key' => 'test_custom_field', 'value' => 12345678); $this->post_custom_field['id'] = add_post_meta($this->post_id, $this->post_custom_field['key'], $this->post_custom_field['value']); }
function setUp() { parent::setUp(); $this->post_id = $this->factory->post->create(array('post_content' => 'edit1')); wp_insert_post(array('ID' => $this->post_id, 'post_content' => 'edit2')); $revisions = wp_get_post_revisions($this->post_id); $revision = array_shift($revisions); $this->revision_id = $revision->ID; }
function setUp() { parent::setUp(); $this->parent_term = wp_insert_term('parent' . rand_str(), 'category'); $this->assertInternalType('array', $this->parent_term); $this->child_term = wp_insert_term('child' . rand_str(), 'category'); $this->assertInternalType('array', $this->child_term); $this->post_tag = wp_insert_term('test' . rand_str(), 'post_tag'); $this->assertInternalType('array', $this->post_tag); }
function setUp() { parent::setUp(); $this->post_id = $this->factory->post->create(array('post_content' => 'edit1')); // Not saved as a revision // First saved revision on update, see https://core.trac.wordpress.org/changeset/24650 wp_insert_post(array('ID' => $this->post_id, 'post_content' => 'edit2')); $revisions = wp_get_post_revisions($this->post_id); //$revision = array_shift( $revisions ); // First revision is empty - https://core.trac.wordpress.org/changeset/23842 // First revision is NOT empty, see https://core.trac.wordpress.org/changeset/24650 $revision = array_shift($revisions); $this->revision_id = $revision->ID; }
function tearDown() { remove_theme_support('post-thumbnails'); parent::tearDown(); }
function tearDown() { parent::tearDown(); wp_delete_post($this->post_id); }
function setUp() { parent::setUp(); $this->post_id = $this->factory->post->create(); $this->factory->comment->create_post_comments($this->post_id, 15); }
function tearDown() { _unregister_post_type($this->cpt_name); parent::tearDown(); }
public function tearDown() { $this->remove_added_uploads(); parent::tearDown(); }
function tearDown() { remove_theme_support('post-thumbnails'); $this->remove_added_uploads(); parent::tearDown(); }