Merge "Use expectException() in ActionTest"
This commit is contained in:
commit
8274d7dbd6
1 changed files with 4 additions and 11 deletions
|
|
@ -269,11 +269,8 @@ class ActionTest extends MediaWikiIntegrationTestCase {
|
||||||
$user = $this->getTestUser()->getUser();
|
$user = $this->getTestUser()->getUser();
|
||||||
$this->overrideUserPermissions( $user, [] );
|
$this->overrideUserPermissions( $user, [] );
|
||||||
$action = $this->getAction( 'access' );
|
$action = $this->getAction( 'access' );
|
||||||
try {
|
$this->expectException( PermissionsError::class );
|
||||||
$action->canExecute( $user );
|
$action->canExecute( $user );
|
||||||
} catch ( Exception $e ) {
|
|
||||||
$this->assertInstanceOf( PermissionsError::class, $e );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCanExecuteRequiresUnblock() {
|
public function testCanExecuteRequiresUnblock() {
|
||||||
|
|
@ -297,12 +294,8 @@ class ActionTest extends MediaWikiIntegrationTestCase {
|
||||||
->method( 'getBlock' )
|
->method( 'getBlock' )
|
||||||
->willReturn( $block );
|
->willReturn( $block );
|
||||||
|
|
||||||
try {
|
$this->expectException( UserBlockedError::class );
|
||||||
$action->canExecute( $user );
|
$action->canExecute( $user );
|
||||||
$this->assertFalse( true );
|
|
||||||
} catch ( Exception $e ) {
|
|
||||||
$this->assertInstanceOf( UserBlockedError::class, $e );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue