public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->post = $this->factory->post->create_and_get(array('post_status' => 'draft', 'post_content' => rand_str(), 'post_title' => rand_str())); $this->post_id = $this->post->ID; }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; // insert a post $this->post = $this->factory->post->create_and_get(array('post_title' => rand_str(), 'post_date' => '2009-07-01 00:00:00')); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->user_id = wp_create_user(rand_str(), rand_str(), '*****@*****.**'); $this->user = get_user_by('id', $this->user_id); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->post_id = $this->factory->post->create(array('post_title' => rand_str(), 'post_date' => '2009-07-01 00:00:00')); $this->post = get_post($this->post_id); $this->custom_datasource = new Fieldmanager_Datasource(array('options' => array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = TRUE; $this->post = array('post_status' => 'publish', 'post_content' => rand_str(), 'post_title' => rand_str()); // insert a post $this->post_id = wp_insert_post($this->post); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->current_user = get_current_user_id(); wp_set_current_user($this->factory->user->create(array('role' => 'administrator'))); $this->term = $this->factory->category->create_and_get(array('name' => rand_str())); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->post = array('post_status' => 'publish', 'post_content' => rand_str(), 'post_title' => rand_str()); // insert a post $this->post_id = wp_insert_post($this->post); // reload as proper object $this->post = get_post($this->post_id); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->author = $this->factory->user->create(array('role' => 'author', 'user_login' => 'author', 'user_email' => '*****@*****.**', 'display_name' => 'Lorem Ipsum')); $this->editor = $this->factory->user->create(array('role' => 'editor', 'user_login' => 'editor')); $this->administrator = $this->factory->user->create(array('role' => 'administrator', 'user_login' => 'administrator')); wp_set_current_user($this->administrator); $this->post = $this->factory->post->create_and_get(array('post_status' => 'draft', 'post_content' => rand_str(), 'post_title' => rand_str(), 'post_author' => $this->author)); }
public function setUp() { parent::setUp(); add_filter('user_can_richedit', '__return_true'); Fieldmanager_Field::$debug = TRUE; $this->post = array('post_status' => 'publish', 'post_content' => rand_str(), 'post_title' => rand_str()); // insert a post $this->post_id = wp_insert_post($this->post); $this->post = get_post($this->post_id); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = true; $this->author = $this->factory->user->create(array('role' => 'author', 'user_login' => 'author')); $this->editor = $this->factory->user->create(array('role' => 'editor', 'user_login' => 'editor')); wp_set_current_user($this->editor); $this->parent_post = $this->factory->post->create_and_get(array('post_status' => 'draft', 'post_content' => rand_str(), 'post_title' => rand_str(), 'post_author' => $this->author)); $this->child_post_a = $this->factory->post->create_and_get(array('post_status' => 'draft', 'post_content' => rand_str(), 'post_title' => rand_str(), 'post_author' => $this->author)); $this->child_post_b = $this->factory->post->create_and_get(array('post_status' => 'draft', 'post_content' => rand_str(), 'post_title' => rand_str(), 'post_author' => $this->editor)); }
public function setUp() { parent::setUp(); Fieldmanager_Field::$debug = TRUE; $this->current_user = get_current_user_id(); wp_set_current_user($this->factory->user->create(array('role' => 'administrator'))); $this->taxonomy = 'category'; $term = wp_insert_term('test', $this->taxonomy); $this->term_id = $term['term_id']; $this->tt_id = $term['term_taxonomy_id']; // reload as proper object $this->term = get_term($this->term_id, $this->taxonomy); }
/** * Test that using an option not listed in the base or extended class will * throw an exception when debug mode is enabled. * * @expectedException FM_Developer_Exception */ public function test_invalid_option_debug() { Fieldmanager_Field::$debug = true; $base = new Fieldmanager_Group(array('name' => 'base_group', 'fake' => 'field', 'meta_box_actions_added' => 'foobar')); }