Index: tests/term.php
===================================================================
--- tests/term.php	(revision 1202)
+++ tests/term.php	(working copy)
@@ -85,6 +85,63 @@
 		$this->assertTrue( wp_delete_term($t['term_id'], $this->taxonomy) );
 	}
 
+	/**
+	 * Test inserting a new term with a parent
+	 */
+	function test_insert_term_with_parent_by_id() {
+		
+		$term_parent = wp_insert_term( 'My test parent Term', 'category' );
+
+		$term_child = wp_insert_term( 'My child term', 'category', array( 'parent' => $term_parent['term_id'] ) );
+
+		$term_chid_object = get_term( (int) $term_child['term_id'], 'category' );
+
+		wp_delete_term( $term_parent['term_id'], 'category' );
+		wp_delete_term( $term_child['term_id'], 'category' );
+
+		$this->assertEquals( $term_parent['term_id'], $term_chid_object->parent );
+	}
+
+	/**
+	 * @ticket 23378
+	 */
+	function test_insert_term_with_parent_by_slug() {
+		
+		$term_parent = wp_insert_term( 'My test parent Term', 'category' );
+		$term_parent_object = get_term( (int) $term_parent['term_id'], 'category' );
+
+		$term_child = wp_insert_term( 'My child term', 'category', array( 'parent' => $term_parent_object->slug ) );
+
+		$term_chid_object = get_term( (int) $term_child['term_id'], 'category' );
+
+		wp_delete_term( $term_parent['term_id'], 'category' );
+		wp_delete_term( $term_child['term_id'], 'category' );
+
+		$this->assertEquals( $term_parent['term_id'], $term_chid_object->parent );
+
+	}
+
+	/**
+	 * @ticket 23378
+	 */
+	function test_update_term_with_parent_by_slug() {
+		
+		$term_parent = wp_insert_term( 'My test parent Term', 'category' );
+		$term_parent_object = get_term( (int) $term_parent['term_id'], 'category' );
+
+		$term_child = wp_insert_term( 'My child term', 'category' );
+
+		wp_update_term( (int) $term_child['term_id'], 'category', array( 'parent' => $term_parent_object->slug ) );
+
+		$term_chid_object = get_term( (int) $term_child['term_id'], 'category' );
+
+		wp_delete_term( $term_parent['term_id'], 'category' );
+		wp_delete_term( $term_child['term_id'], 'category' );
+
+		$this->assertEquals( $term_parent['term_id'], $term_chid_object->parent );
+
+	}
+
 	function test_set_object_terms_by_id() {
 		$ids = $this->factory->post->create_many(5);
 
