@@ -118,46 +118,6 @@ public function test_getSubscribedEvents()
118118 ), array_keys (\phpbb \ideas \event \listener::getSubscribedEvents ()));
119119 }
120120
121- /**
122- * Data set for test_clean_message
123- *
124- * @return array Array of test data
125- */
126- public function clean_message_data ()
127- {
128- return array (
129- array (1 , 1 , 1 , 'Foo Bar ' , 'Foo Bar ' ), // Invalid forum, nothing cleaned
130- array (2 , 1 , 2 , 'Foo Bar ' , 'Foo Bar ' ), // Invalid post, nothing clean
131- array (2 , 1 , 1 , 'Foo Bar ' , 'Foo Bar ' ), // Valid post, nothing to clean
132- array (2 , 1 , 1 , 'Foo Bar<br />----------<br>BarFoo<br> ' , 'Foo Bar ' ), // Valid post, requires cleaning
133- array (2 , 1 , 1 , 'Foo Bar<br />\n\n----------<br>\nBarFoo<br> ' , 'Foo Bar ' ), // Valid post, requires cleaning
134- array (2 , 1 , 1 , 'Foo Bar<br />--------<br>BarFoo<br> ' , 'Foo Bar<br />--------<br>BarFoo<br> ' ), // Valid post, nothing to clean
135- );
136- }
137-
138- /**
139- * Test the clean_message event
140- *
141- * @dataProvider clean_message_data
142- */
143- public function test_clean_message ($ forum_id , $ post_id , $ first_post_id , $ message , $ expected )
144- {
145- $ listener = $ this ->get_listener ();
146-
147- $ event = new \phpbb \event \data (array (
148- 'row ' => array (
149- 'forum_id ' => $ forum_id ,
150- 'post_id ' => $ post_id ,
151- ),
152- 'post_row ' => array ('MESSAGE ' => $ message ),
153- 'topic_data ' => array ('topic_first_post_id ' => $ first_post_id ),
154- ));
155-
156- $ listener ->clean_message ($ event );
157-
158- $ this ->assertContains ($ expected , $ event ['post_row ' ]['MESSAGE ' ]);
159- }
160-
161121 /**
162122 * Data set for show_post_buttons
163123 *
0 commit comments