コード例 #1
0
 public function test_sync_deletes()
 {
     $edits_json = $this->_read_json_file('sync-many-deletes.json');
     $sync = new SpotIM_Sync($this->_post_id, $edits_json);
     $results = $sync->sync();
     // got edits for r- and c-?
     $this->assertEquals(1, $results['c-']);
     $this->assertEquals(1, $results['r-']);
     // after 2 comments removed, we should have 3.
     $this->assertCount(3, get_comments(array('post_id' => $this->_post_id)));
 }
コード例 #2
0
 /**
  * Sync.
  *
  * @since 2.2
  * @param array $data
  * @return array
  */
 public function sync($id, $data)
 {
     $sync_instance = new SpotIM_Sync($id, $data);
     return $sync_instance->sync();
 }