public function setUp() { parent::setUp(); // Set a user so the $post has 'post_author' $this->user_id = $this->factory->user->create(array('role' => 'administrator')); $form = $this->factory->form->create_and_get(); $this->assertNotEmpty($form); $this->form_id = $form->id; }
public function setUp() { parent::setUp(); $this->user_id = $this->factory->user->create(array('role' => 'administrator')); wp_set_current_user($this->user_id); }