dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Don't pass Config to Parser(Factory)"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
api
/
ApiBlockTest.php
diff --git
a/tests/phpunit/includes/api/ApiBlockTest.php
b/tests/phpunit/includes/api/ApiBlockTest.php
index
01455ed
..
1c53147
100644
(file)
--- a/
tests/phpunit/includes/api/ApiBlockTest.php
+++ b/
tests/phpunit/includes/api/ApiBlockTest.php
@@
-62,7
+62,7
@@
class ApiBlockTest extends ApiTestCase {
$this->assertTrue( !is_null( $block ), 'Block is valid' );
$this->assertSame( $this->mUser->getName(), (string)$block->getTarget() );
$this->assertTrue( !is_null( $block ), 'Block is valid' );
$this->assertSame( $this->mUser->getName(), (string)$block->getTarget() );
- $this->assertSame( 'Some reason', $block->
mReason
);
+ $this->assertSame( 'Some reason', $block->
getReason()
);
return $ret;
}
return $ret;
}
@@
-175,6
+175,12
@@
class ApiBlockTest extends ApiTestCase {
}
public function testBlockWithEmailBlock() {
}
public function testBlockWithEmailBlock() {
+ $this->setMwGlobals( [
+ 'wgEnableEmail' => true,
+ 'wgEnableUserEmail' => true,
+ 'wgSysopEmailBans' => true,
+ ] );
+
$res = $this->doBlock( [ 'noemail' => '' ] );
$dbw = wfGetDB( DB_MASTER );
$res = $this->doBlock( [ 'noemail' => '' ] );
$dbw = wfGetDB( DB_MASTER );
@@
-187,6
+193,12
@@
class ApiBlockTest extends ApiTestCase {
}
public function testBlockWithProhibitedEmailBlock() {
}
public function testBlockWithProhibitedEmailBlock() {
+ $this->setMwGlobals( [
+ 'wgEnableEmail' => true,
+ 'wgEnableUserEmail' => true,
+ 'wgSysopEmailBans' => true,
+ ] );
+
$this->setExpectedException( ApiUsageException::class,
"You don't have permission to block users from sending email through the wiki." );
$this->setExpectedException( ApiUsageException::class,
"You don't have permission to block users from sending email through the wiki." );