Index: /CKEditor/tests/tt/5617/1.html
===================================================================
--- /CKEditor/tests/tt/5617/1.html	(revision 5458)
+++ /CKEditor/tests/tt/5617/1.html	(revision 5458)
@@ -0,0 +1,94 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Test Ticket #5617</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+CKEDITOR.test.runner.defer = true;
+CKEDITOR.plugins.load( 'htmlwriter' , function()
+{
+ CKEDITOR.test.runner.run();
+} );
+
+var tc;
+CKEDITOR.test.addTestCase( tc = ( function()
+{
+	// Local reference to the "assert" object.
+	var assert = CKEDITOR.test.assert;
+
+	/**
+	 * Wrapper of the combination of htmlParser with htmlWriter, for convenience of
+	 * testing, formatting of writer has been disabled.
+	 */
+	function htmlParse( htmlString, filter )
+	{
+		var writer = new CKEDITOR.htmlParser.basicWriter(),
+				fragment = CKEDITOR.htmlParser.fragment.fromHtml( htmlString );
+		fragment.writeHtml( writer, filter );
+		return writer.getHtml();
+	}
+
+	return {
+
+		// Test applying filter rules of duplicate name.
+		test_filter_rules_same_name : function()
+		{
+			var filter = new CKEDITOR.htmlParser.filter();
+			filter.addRules( {
+				elements : {
+					div : function( element )
+					{
+						assert.areSame( CKEDITOR.NODE_ELEMENT, element.type );
+						assert.areSame( 'div', element.name );
+						element.name = 'span';
+						return element;
+					}
+				},
+				attributes : {
+					'class' : function( attrValue )
+					{
+						assert.areSame( 'class1', attrValue );
+						return 'class2';
+					}
+				},
+				text : function( value )
+				{
+					assert.areSame( 'some text', value );
+					return 'some other text';
+				}
+			} );
+
+			filter.addRules( {
+				elements :
+				{
+					div : function( element )
+					{
+						assert.fail( 'This filter should not be applied.');
+					}
+				},
+				attributes : {
+					'class' : function( attrValue )
+					{
+						assert.areSame( 'class2', attrValue );
+						return attrValue;
+					}
+				},
+				text : function( text )
+				{
+					assert.areSame( 'some other text', text );
+					return text;
+				}
+			} );
+			assert.areSame( '<span class="class2">some other text</span>', htmlParse( '<div class="class1">some text</div>', filter ) );
+		},
+
+		name : document.title
+	};
+} )() );
+	//]]>
+	</script>
+</head>
+<body>
+</html>
