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 "Added "maxPartitionsTry" option to JobQueueFederated"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
TitleTest.php
diff --git
a/tests/phpunit/includes/TitleTest.php
b/tests/phpunit/includes/TitleTest.php
index
da663c4
..
6bfe545
100644
(file)
--- a/
tests/phpunit/includes/TitleTest.php
+++ b/
tests/phpunit/includes/TitleTest.php
@@
-1,7
+1,6
@@
<?php
/**
<?php
/**
- *
* @group Database
* ^--- needed for language cache stuff
*/
* @group Database
* ^--- needed for language cache stuff
*/
@@
-19,7
+18,10
@@
class TitleTest extends MediaWikiTestCase {
) );
}
) );
}
- function testLegalChars() {
+ /**
+ * @covers Title::legalChars
+ */
+ public function testLegalChars() {
$titlechars = Title::legalChars();
foreach ( range( 1, 255 ) as $num ) {
$titlechars = Title::legalChars();
foreach ( range( 1, 255 ) as $num ) {
@@
-34,8
+36,10
@@
class TitleTest extends MediaWikiTestCase {
/**
* See also mediawiki.Title.test.js
/**
* See also mediawiki.Title.test.js
+ * @covers Title::secureAndSplit
+ * @todo This method should be split into 2 separate tests each with a provider
*/
*/
- function testSecureAndSplit() {
+
public
function testSecureAndSplit() {
// Valid
foreach ( array(
'Sandbox',
// Valid
foreach ( array(
'Sandbox',
@@
-171,15
+175,17
@@
class TitleTest extends MediaWikiTestCase {
/**
* @dataProvider provideConvertByteClassToUnicodeClass
/**
* @dataProvider provideConvertByteClassToUnicodeClass
+ * @covers Title::convertByteClassToUnicodeClass
*/
*/
- function testConvertByteClassToUnicodeClass( $byteClass, $unicodeClass ) {
+
public
function testConvertByteClassToUnicodeClass( $byteClass, $unicodeClass ) {
$this->assertEquals( $unicodeClass, Title::convertByteClassToUnicodeClass( $byteClass ) );
}
/**
* @dataProvider provideBug31100
$this->assertEquals( $unicodeClass, Title::convertByteClassToUnicodeClass( $byteClass ) );
}
/**
* @dataProvider provideBug31100
+ * @covers Title::fixSpecialName
*/
*/
- function testBug31100FixSpecialName( $text, $expectedParam ) {
+
public
function testBug31100FixSpecialName( $text, $expectedParam ) {
$title = Title::newFromText( $text );
$fixed = $title->fixSpecialName();
$stuff = explode( '/', $fixed->getDBkey(), 2 );
$title = Title::newFromText( $text );
$fixed = $title->fixSpecialName();
$stuff = explode( '/', $fixed->getDBkey(), 2 );
@@
-205,10
+211,11
@@
class TitleTest extends MediaWikiTestCase {
* @group Database
* @param string $source
* @param string $target
* @group Database
* @param string $source
* @param string $target
- * @param array|string|
true
$expected Required error
+ * @param array|string|
bool
$expected Required error
* @dataProvider provideTestIsValidMoveOperation
* @dataProvider provideTestIsValidMoveOperation
+ * @covers Title::isValidMoveOperation
*/
*/
- function testIsValidMoveOperation( $source, $target, $expected ) {
+
public
function testIsValidMoveOperation( $source, $target, $expected ) {
$title = Title::newFromText( $source );
$nt = Title::newFromText( $target );
$errors = $title->isValidMoveOperation( $nt, false );
$title = Title::newFromText( $source );
$nt = Title::newFromText( $target );
$errors = $title->isValidMoveOperation( $nt, false );
@@
-225,7
+232,7
@@
class TitleTest extends MediaWikiTestCase {
/**
* Provides test parameter values for testIsValidMoveOperation()
*/
/**
* Provides test parameter values for testIsValidMoveOperation()
*/
- function dataTestIsValidMoveOperation() {
+
public
function dataTestIsValidMoveOperation() {
return array(
array( 'Test', 'Test', 'selfmove' ),
array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' )
return array(
array( 'Test', 'Test', 'selfmove' ),
array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' )
@@
-238,12
+245,12
@@
class TitleTest extends MediaWikiTestCase {
* @param array $whitelistRegexp
* @param string $source
* @param string $action
* @param array $whitelistRegexp
* @param string $source
* @param string $action
- * @param array|string|
true
$expected Required error
+ * @param array|string|
bool
$expected Required error
*
* @covers Title::checkReadPermissions
* @dataProvider dataWgWhitelistReadRegexp
*/
*
* @covers Title::checkReadPermissions
* @dataProvider dataWgWhitelistReadRegexp
*/
- function testWgWhitelistReadRegexp( $whitelistRegexp, $source, $action, $expected ) {
+
public
function testWgWhitelistReadRegexp( $whitelistRegexp, $source, $action, $expected ) {
// $wgWhitelistReadRegexp must be an array. Since the provided test cases
// usually have only one regex, it is more concise to write the lonely regex
// as a string. Thus we cast to an array() to honor $wgWhitelistReadRegexp
// $wgWhitelistReadRegexp must be an array. Since the provided test cases
// usually have only one regex, it is more concise to write the lonely regex
// as a string. Thus we cast to an array() to honor $wgWhitelistReadRegexp
@@
-300,7
+307,7
@@
class TitleTest extends MediaWikiTestCase {
/**
* Provides test parameter values for testWgWhitelistReadRegexp()
*/
/**
* Provides test parameter values for testWgWhitelistReadRegexp()
*/
- function dataWgWhitelistReadRegexp() {
+
public
function dataWgWhitelistReadRegexp() {
$ALLOWED = true;
$DISALLOWED = false;
$ALLOWED = true;
$DISALLOWED = false;
@@
-336,7
+343,7
@@
class TitleTest extends MediaWikiTestCase {
);
}
);
}
- function flattenErrorsArray( $errors ) {
+
public
function flattenErrorsArray( $errors ) {
$result = array();
foreach ( $errors as $error ) {
$result[] = $error[0];
$result = array();
foreach ( $errors as $error ) {
$result[] = $error[0];
@@
-353,9
+360,10
@@
class TitleTest extends MediaWikiTestCase {
}
/**
}
/**
- * @dataProvider provideCasesForGetpageviewlanguage
+ * @dataProvider provideGetPageViewLanguage
+ * @covers Title::getPageViewLanguage
*/
*/
-
function testGetpageviewl
anguage( $expected, $titleText, $contLang, $lang, $variant, $msg = '' ) {
+
public function testGetPageViewL
anguage( $expected, $titleText, $contLang, $lang, $variant, $msg = '' ) {
global $wgLanguageCode, $wgContLang, $wgLang, $wgDefaultLanguageVariant, $wgAllowUserJs;
// Setup environnement for this test
global $wgLanguageCode, $wgContLang, $wgLang, $wgDefaultLanguageVariant, $wgAllowUserJs;
// Setup environnement for this test
@@
-375,7
+383,7
@@
class TitleTest extends MediaWikiTestCase {
);
}
);
}
- public static function provide
CasesForGetpageviewl
anguage() {
+ public static function provide
GetPageViewL
anguage() {
# Format:
# - expected
# - Title name
# Format:
# - expected
# - Title name
@@
-416,8
+424,9
@@
class TitleTest extends MediaWikiTestCase {
/**
* @dataProvider provideBaseTitleCases
/**
* @dataProvider provideBaseTitleCases
+ * @covers Title::getBaseText
*/
*/
-
function testExtractingBaseTextFromTitle
( $title, $expected, $msg = '' ) {
+
public function testGetBaseText
( $title, $expected, $msg = '' ) {
$title = Title::newFromText( $title );
$this->assertEquals( $expected,
$title->getBaseText(),
$title = Title::newFromText( $title );
$this->assertEquals( $expected,
$title->getBaseText(),
@@
-435,8
+444,9
@@
class TitleTest extends MediaWikiTestCase {
/**
* @dataProvider provideRootTitleCases
/**
* @dataProvider provideRootTitleCases
+ * @covers Title::getRootText
*/
*/
-
function testExtractingRootTextFromTitle
( $title, $expected, $msg = '' ) {
+
public function testGetRootText
( $title, $expected, $msg = '' ) {
$title = Title::newFromText( $title );
$this->assertEquals( $expected,
$title->getRootText(),
$title = Title::newFromText( $title );
$this->assertEquals( $expected,
$title->getRootText(),
@@
-455,8
+465,9
@@
class TitleTest extends MediaWikiTestCase {
/**
* @todo Handle $wgNamespacesWithSubpages cases
* @dataProvider provideSubpageTitleCases
/**
* @todo Handle $wgNamespacesWithSubpages cases
* @dataProvider provideSubpageTitleCases
+ * @covers Title::getSubpageText
*/
*/
-
function testExtractingSubpageTextFromTitle
( $title, $expected, $msg = '' ) {
+
public function testGetSubpageText
( $title, $expected, $msg = '' ) {
$title = Title::newFromText( $title );
$this->assertEquals( $expected,
$title->getSubpageText(),
$title = Title::newFromText( $title );
$this->assertEquals( $expected,
$title->getSubpageText(),