Index: tests/term.php
===================================================================
--- tests/term.php	(revision 1219)
+++ tests/term.php	(working copy)
@@ -272,6 +272,35 @@
 		$this->assertTrue( is_wp_error($result) );
 	}
 
+	/**
+	 * @ticket 15475
+	 */
+	function test_wp_add_remove_object_terms() {
+		$posts = $this->factory->post->create_many( 5 );
+		$tags = $this->factory->tag->create_many( 5 );
+
+		$tt = wp_add_object_terms( $posts[0], $tags[1], 'post_tag' );
+		$this->assertEquals( 1, count( $tt ) );
+		$this->assertEquals( array( $tags[1] ), wp_get_object_terms( $posts[0], 'post_tag', array( 'fields' => 'ids' ) ) );
+
+		$three_tags = array( $tags[0], $tags[1], $tags[2] );
+		$tt = wp_add_object_terms( $posts[1], $three_tags, 'post_tag' );
+		$this->assertEquals( 3, count( $tt ) );
+		$this->assertEquals( $three_tags, wp_get_object_terms( $posts[1], 'post_tag', array( 'fields' => 'ids' ) ) );
+
+		$this->assertTrue( wp_remove_object_terms( $posts[0], $tags[1], 'post_tag' ) );
+		$this->assertFalse( wp_remove_object_terms( $posts[0], $tags[0], 'post_tag' ) );
+		$this->assertTrue( wp_remove_object_terms( $posts[0], $tags[1], 'non_existing_taxonomy' ) instanceof WP_Error );
+		$this->assertTrue( wp_remove_object_terms( $posts[1], $three_tags, 'post_tag' ) );
+		$this->assertEquals( 0, count( wp_get_object_terms( $posts[1], 'post_tag' ) ) );
+
+		foreach ( $tags as $term_id )
+			$this->assertTrue( wp_delete_term( $term_id, 'post_tag' ) );
+
+		foreach ( $posts as $post_id )
+			$this->assertTrue( (bool) wp_delete_post( $post_id, true ) );
+	}
+
 	function test_term_is_ancestor_of( ) {
 		$term = rand_str();
 		$term2 = rand_str();
