Esempio n. 1
0
 function test_term_meta_is_pushed_to_remote_wp()
 {
     $master = new Master();
     $taxonomy = 'post_tag';
     $term = wp_insert_term('test_term', $taxonomy, array('description' => 'test description'));
     if (is_wp_error($term)) {
         var_dump($term);
         throw new Exception("Error in wp_insert_term");
     }
     $term_id = $term['term_id'];
     $result = wp_set_post_terms($this->ID, array($term_id), $taxonomy);
     $master->push($this->post, $this->site);
     $mapping = get_term_meta($term_id, MAPPING_META_KEY, true);
     $remote_id = $mapping[$this->site];
     $meta_id = update_term_meta($term_id, "test_meta_key", "dummy");
     $master->update_term_meta($meta_id, $term_id, "test_meta_key", "dummy");
     $this->assertEquals("dummy", get_term_meta($remote_id, "test_meta_key", true));
 }