mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
User mock must return Block instance from getBlock.
Change-Id: I569e91dd07b8f89af42344b6d6df87560dcb6bbe Needed-By: T271494
This commit is contained in:
parent
b592251616
commit
54285fe984
|
@ -5,6 +5,7 @@ namespace MediaWiki\Extension\AbuseFilter\Tests\Unit;
|
|||
use Generator;
|
||||
use Language;
|
||||
use LogicException;
|
||||
use MediaWiki\Block\SystemBlock;
|
||||
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
|
||||
use MediaWiki\Extension\AbuseFilter\Parser\AFPData;
|
||||
use MediaWiki\Extension\AbuseFilter\TextExtractor;
|
||||
|
@ -204,10 +205,10 @@ class LazyVariableComputerTest extends MediaWikiUnitTestCase {
|
|||
$var = $getUserVar( $user, 'user-rights' );
|
||||
yield 'user_rights' => [ $var, $rights, [ null, null, $permissionManager ] ];
|
||||
|
||||
$blocked = true;
|
||||
$user->method( 'getBlock' )->willReturn( $blocked );
|
||||
$block = new SystemBlock( [] );
|
||||
$user->method( 'getBlock' )->willReturn( $block );
|
||||
$var = $getUserVar( $user, 'user-block' );
|
||||
yield 'user_blocked' => [ $var, $blocked ];
|
||||
yield 'user_blocked' => [ $var, (bool)$block ];
|
||||
|
||||
$fakeTime = 1514700000;
|
||||
|
||||
|
|
Loading…
Reference in a new issue