VectorComponentTableOfContentsTest: Add mocks for Message:: escaped() and rawParams()

Needed for new security patch.

Change-Id: I9295a8e0f9f00b62d5206f6d7e40bb657f436510
(cherry picked from commit 507de0f4e2)
This commit is contained in:
James D. Forrester 2023-09-28 20:30:11 -04:00 committed by Jforrester
parent 4eca3c3198
commit c999dff13a

View file

@ -186,6 +186,8 @@ class VectorComponentTableOfContentsTest extends \MediaWikiUnitTestCase {
$localizer->method( 'msg' )->willReturnCallback( function ( $key, ...$params ) {
$msg = $this->createMock( Message::class );
$msg->method( '__toString' )->willReturn( $key );
$msg->method( 'escaped' )->willReturn( $key );
$msg->method( 'rawParams' )->will( $this->returnSelf() );
$msg->method( 'text' )->willReturn( $key );
return $msg;
} );