MediaWiki
1.34.0
BaseBlacklistTest.php
Go to the documentation of this file.
1
<?php
2
25
class
BaseBlacklistTest
extends
MediaWikiTestCase {
26
30
public
static
function
provideGetTypeFromTitle
() {
31
return
[
32
[
'MediaWiki:Spam-blacklist'
,
'spam'
],
33
[
'MediaWiki:Spam-whitelist'
,
'spam'
],
34
[
'MediaWiki:Email-whitelist'
,
'email'
],
35
[
'MediaWiki:Email-blacklist'
,
'email'
],
36
[
'MediaWiki:A random page'
, false ],
37
[
'Another random page'
, false ],
38
];
39
}
40
46
public
function
testGetTypeFromTitle
(
$title
, $expected ) {
47
$title
=
Title::newFromText
(
$title
);
48
$output
=
BaseBlacklist::getTypeFromTitle
(
$title
);
49
$this->assertEquals( $expected,
$output
);
50
}
51
}
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition:
Title.php:316
BaseBlacklist\getTypeFromTitle
static getTypeFromTitle(Title $title)
Returns the type of blacklist from the given title.
Definition:
BaseBlacklist.php:205
$title
$title
Definition:
testCompression.php:34
$output
$output
Definition:
SyntaxHighlight.php:335
BaseBlacklistTest\provideGetTypeFromTitle
static provideGetTypeFromTitle()
Definition:
BaseBlacklistTest.php:30
BaseBlacklistTest
@covers BaseBlacklist
Definition:
BaseBlacklistTest.php:25
BaseBlacklistTest\testGetTypeFromTitle
testGetTypeFromTitle( $title, $expected)
@dataProvider provideGetTypeFromTitle
Definition:
BaseBlacklistTest.php:46
extensions
SpamBlacklist
tests
phpunit
BaseBlacklistTest.php
Generated on Thu Dec 19 2019 14:53:59 for MediaWiki by
1.8.16