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 "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
title
/
NamespaceAwareForeignTitleFactoryTest.php
diff --git
a/tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php
b/tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php
index
9cb195c
..
520108a
100644
(file)
--- a/
tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php
+++ b/
tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php
@@
-27,36
+27,49
@@
class NamespaceAwareForeignTitleFactoryTest extends MediaWikiTestCase {
public function basicProvider() {
class NamespaceAwareForeignTitleFactoryTest extends MediaWikiTestCase {
public function basicProvider() {
- return
array(
- array(
+ return
[
+ [
'MainNamespaceArticle', 0,
new ForeignTitle( 0, '', 'MainNamespaceArticle' ),
'MainNamespaceArticle', 0,
new ForeignTitle( 0, '', 'MainNamespaceArticle' ),
-
)
,
- array(
+
]
,
+ [
'MainNamespaceArticle', null,
new ForeignTitle( 0, '', 'MainNamespaceArticle' ),
'MainNamespaceArticle', null,
new ForeignTitle( 0, '', 'MainNamespaceArticle' ),
- ),
- array(
+ ],
+ [
+ 'Magic:_The_Gathering', 0,
+ new ForeignTitle( 0, '', 'Magic:_The_Gathering' ),
+ ],
+ [
'Talk:Nice_talk', 1,
new ForeignTitle( 1, 'Talk', 'Nice_talk' ),
'Talk:Nice_talk', 1,
new ForeignTitle( 1, 'Talk', 'Nice_talk' ),
- ),
- array(
+ ],
+ [
+ 'Talk:Magic:_The_Gathering', 1,
+ new ForeignTitle( 1, 'Talk', 'Magic:_The_Gathering' ),
+ ],
+ [
'Bogus:Nice_talk', 0,
new ForeignTitle( 0, '', 'Bogus:Nice_talk' ),
'Bogus:Nice_talk', 0,
new ForeignTitle( 0, '', 'Bogus:Nice_talk' ),
-
)
,
- array(
+
]
,
+ [
'Bogus:Nice_talk', null,
new ForeignTitle( 9000, 'Bogus', 'Nice_talk' ),
'Bogus:Nice_talk', null,
new ForeignTitle( 9000, 'Bogus', 'Nice_talk' ),
-
)
,
- array(
+
]
,
+ [
'Bogus:Nice_talk', 4,
new ForeignTitle( 4, 'Bogus', 'Nice_talk' ),
'Bogus:Nice_talk', 4,
new ForeignTitle( 4, 'Bogus', 'Nice_talk' ),
-
)
,
- array(
+
]
,
+ [
'Bogus:Nice_talk', 1,
new ForeignTitle( 1, 'Talk', 'Nice_talk' ),
'Bogus:Nice_talk', 1,
new ForeignTitle( 1, 'Talk', 'Nice_talk' ),
- ),
- );
+ ],
+ // Misconfigured wiki with unregistered namespace (T114115)
+ [
+ 'Nice_talk', 1234,
+ new ForeignTitle( 1234, 'Ns1234', 'Nice_talk' ),
+ ],
+ ];
}
/**
}
/**
@@
-64,9
+77,9
@@
class NamespaceAwareForeignTitleFactoryTest extends MediaWikiTestCase {
*/
public function testBasic( $title, $ns, ForeignTitle $foreignTitle ) {
*/
public function testBasic( $title, $ns, ForeignTitle $foreignTitle ) {
- $foreignNamespaces =
array(
+ $foreignNamespaces =
[
0 => '', 1 => 'Talk', 100 => 'Portal', 9000 => 'Bogus'
0 => '', 1 => 'Talk', 100 => 'Portal', 9000 => 'Bogus'
-
)
;
+
]
;
$factory = new NamespaceAwareForeignTitleFactory( $foreignNamespaces );
$testTitle = $factory->createForeignTitle( $title, $ns );
$factory = new NamespaceAwareForeignTitleFactory( $foreignNamespaces );
$testTitle = $factory->createForeignTitle( $title, $ns );