Index: tests/phpunit/tests/taxonomy.php
===================================================================
--- tests/phpunit/tests/taxonomy.php	(revision 31675)
+++ tests/phpunit/tests/taxonomy.php	(working copy)
@@ -389,4 +389,70 @@
 		$this->assertEqualSets( array( $t1 ), get_ancestors( $t2, 'wptests_conflict' ) );
 		_unregister_post_type( 'wptests_pt' );
 	}
+
+	/**
+	 * @ticket 26475
+	 */
+	public function test_wp_terms_checklist() {
+		register_taxonomy( 'wptests_tax', 'post', array(
+			'hierarchical' => true,
+		) );
+
+		$t1 = $this->factory->term->create( array(
+			'taxonomy' => 'wptests_tax',
+		) );
+
+		$t2 = $this->factory->term->create( array(
+			'taxonomy' => 'wptests_tax',
+			'parent' => $t1
+		) );
+
+		$p1 = $this->factory->post->create( array(
+			'post_type' => 'post',
+		) );
+
+		wp_set_post_terms($p1, array($t1, $t2), 'wptests_tax');
+
+		$html = trim(get_echo('wp_terms_checklist', array($p1, array(
+			'taxonomy' => 'wptests_tax', 
+			'descendants_and_self' => $t1, 
+			'selected_cats' => array($t1, $t2), 
+			'popular_cats' => array()
+		))));
+
+		// both the parent and child terms set to the post
+		$expected = '/<input value="' . $t1 . '".*checked=\'checked\'.*\/>.*<ul[^>]*>.*<input value="' . $t2 . '".*checked=\'checked\'.*\/>/s';
+		$this->assertRegExp( $expected, $html );
+
+		wp_remove_object_terms($p1, array($t1), 'wptests_tax');
+
+		$html = trim(get_echo('wp_terms_checklist', array($p1, array(
+			'taxonomy' => 'wptests_tax', 
+			'descendants_and_self' => $t2, 
+			'selected_cats' => array($t2), 
+			'popular_cats' => array()
+		))));
+
+		// the parent term was removed from the post
+		$expected = '/<input value="' . $t1 . '".* id="in-wptests_tax-' . $t1 . '" (?!checked=\'checked\').*\/>.*<ul[^>]*>.*<input value="' . $t2 . '".*checked=\'checked\'.*\/>/s';
+		$this->assertRegExp( $expected, $html );
+
+		$t3 = $this->factory->term->create( array(
+			'taxonomy' => 'wptests_tax',
+			'parent' => $t1
+		) );
+
+		wp_set_post_terms($p1, array($t3), 'wptests_tax', true);
+
+		$html = trim(get_echo('wp_terms_checklist', array($p1, array(
+			'taxonomy' => 'wptests_tax', 
+			'descendants_and_self' => $t2, 
+			'selected_cats' => array($t2, $t3), 
+			'popular_cats' => array()
+		))));
+		
+		// another child term was added to the same parent and assigned to the post
+		$expected = '/<input value="' . $t1 . '".* id="in-wptests_tax-' . $t1 . '" (?!checked=\'checked\').*\/>.*<ul[^>]*>.*<input value="' . $t2 . '".*checked=\'checked\'.*\/>.*<input value="' . $t3 . '".*checked=\'checked\'.*\/>.*<\/ul>/s';
+		$this->assertRegExp( $expected, $html );
+	}
 }
