test: refactor common.expectWarning()
#25251
+119
−108
Closed