/**
  * This function is run before each method
  */
 public function setUp()
 {
     parent::setUp();
     $this->user = $this->factory->user->create();
     wp_set_current_user($this->user);
     $this->fake_server = $this->getMock('WP_JSON_Server');
     $this->endpoint = new WP_JSON_Taxonomies($this->fake_server);
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $this->author_id = $this->factory->user->create(array('role' => 'editor'));
     wp_set_current_user($this->author_id);
     $this->post_id = $this->factory->post->create();
     $this->post_obj = get_post($this->post_id);
     $this->fake_server = $this->getMock('WP_JSON_Server', null);
     $this->endpoint = new WP_JSON_Posts($this->fake_server);
 }
 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');
     $this->fake_server = $this->getMock('WP_JSON_Server');
     $this->endpoint = new WP_JSON_Meta_Posts($this->fake_server);
 }