Index: tests/phpunit/tests/filters.php
===================================================================
--- tests/phpunit/tests/filters.php	(revision 41006)
+++ tests/phpunit/tests/filters.php	(working copy)
@@ -380,4 +380,40 @@
 		global $wp_filter;
 		$this->current_priority = $wp_filter[ 'the_content' ]->current_priority();
 	}
+
+	/**
+	 * @ticket 41185
+	 */
+	public function test_current_priority_after_nested_add_action(){
+		add_action( 'test_current_priority', array( $this, '_nested_action' ), 99 );
+		do_action( 'test_current_priority' );
+		remove_action( 'test_current_priority', array( $this, '_nested_action' ), 99 );
+		remove_action( 'test_current_priority', array( $this, '__return_false' ), 100 );
+
+		$this->assertSame( 99, $this->current_priority );
+	}
+
+	public function _nested_action() {
+		add_action( 'test_current_priority', '__return_false', 100 );
+
+		global $wp_filter;
+		$this->current_priority = $wp_filter[ current_filter() ]->current_priority();
+	}
+
+	/**
+	 * @ticket 41185
+	 */
+
+	public function test_current_filter(){
+		add_action( 'test_current_priority', array( $this, '_match_current_filter' ), 99 );
+		do_action( 'test_current_priority' );
+	}
+
+	public function _match_current_filter(){
+		remove_action( 'test_current_priority', array( $this, '_match_current_filter' ), 99 );
+
+		global $wp_filter;
+		$this->assertTrue( array_key_exists( current_filter(), $wp_filter ) );
+	}
+
 }
