Skip to content

Commit 1dc42d8

Browse files
authored
Update HooksTest.php to look for denyAccessCustom()
1 parent 820d065 commit 1dc42d8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/phpunit/unit/HooksTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function testSpecialPageBlocksAnonymous( $specialPageName ) {
185185
$special->method( 'getContext' )->willReturn( $context );
186186

187187
$runner = $this->getMockBuilder( Hooks::class )
188-
->onlyMethods( [ 'denyAccess', 'denyAccessWith418' ] )
188+
->onlyMethods( [ 'denyAccess', 'denyAccessCustom' ] )
189189
->getMock();
190190
$runner->expects( $this->once() )->method( 'denyAccess' )->with( $output );
191191

@@ -299,9 +299,9 @@ public function getOutput() {
299299

300300
/**
301301
* @covers ::onSpecialPageBeforeExecute
302-
* @covers ::denyAccessWith418
302+
* @covers ::denyAccessCustom
303303
*/
304-
public function testSpecialPageCallsDenyAccessWith418WhenConfigured() {
304+
public function testSpecialPageCallsDenyAccessCustomWhenConfigured() {
305305
// This test only works with our test stubs, not in MediaWiki's PHPUnit environment
306306
if ( !property_exists( '\MediaWiki\MediaWikiServices', 'testUse418' ) ) {
307307
$this->markTestSkipped(
@@ -324,10 +324,10 @@ public function testSpecialPageCallsDenyAccessWith418WhenConfigured() {
324324
$special->method( 'getContext' )->willReturn( $context );
325325

326326
$runner = $this->getMockBuilder( Hooks::class )
327-
->onlyMethods( [ 'denyAccessWith418' ] )
327+
->onlyMethods( [ 'denyAccessCustom' ] )
328328
->getMock();
329-
// When denyFast is true, only denyAccessWith418 is called (it dies before denyAccess)
330-
$runner->expects( $this->once() )->method( 'denyAccessWith418' );
329+
// When $testUse418 is true, only denyAccessCustom is called (it dies before denyAccess)
330+
$runner->expects( $this->once() )->method( 'denyAccessCustom' );
331331

332332
$result = $runner->onSpecialPageBeforeExecute( $special, null );
333333
$this->assertFalse( $result );

0 commit comments

Comments
 (0)