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 "Migration of browsertests* Jenkins jobs to selenium* jobs"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
specials
/
SpecialRecentchangesTest.php
diff --git
a/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
b/tests/phpunit/includes/specials/SpecialRecentchangesTest.php
index
c3d75aa
..
cc16e5f
100644
(file)
--- a/
tests/phpunit/includes/specials/SpecialRecentchangesTest.php
+++ b/
tests/phpunit/includes/specials/SpecialRecentchangesTest.php
@@
-11,6
+11,11
@@
*/
class SpecialRecentchangesTest extends MediaWikiTestCase {
*/
class SpecialRecentchangesTest extends MediaWikiTestCase {
+ protected function setUp() {
+ parent::setUp();
+ $this->setMwGlobals( 'wgRCWatchCategoryMembership', true );
+ }
+
/**
* @var SpecialRecentChanges
*/
/**
* @var SpecialRecentChanges
*/
@@
-26,7
+31,7
@@
class SpecialRecentchangesTest extends MediaWikiTestCase {
$this->rc->setContext( $context );
$formOptions = $this->rc->setup( null );
$this->rc->setContext( $context );
$formOptions = $this->rc->setup( null );
- # Filter out rc_timestamp conditions which depends on the test runtime
+ #
Filter out rc_timestamp conditions which depends on the test runtime
# This condition is not needed as of march 2, 2011 -- hashar
# @todo FIXME: Find a way to generate the correct rc_timestamp
$queryConditions = array_filter(
# This condition is not needed as of march 2, 2011 -- hashar
# @todo FIXME: Find a way to generate the correct rc_timestamp
$queryConditions = array_filter(
@@
-48,27
+53,29
@@
class SpecialRecentchangesTest extends MediaWikiTestCase {
public function testRcNsFilter() {
$this->assertConditions(
public function testRcNsFilter() {
$this->assertConditions(
-
array(
# expected
+
[
# expected
'rc_bot' => 0,
'rc_bot' => 0,
- 0 => "rc_namespace = '0'",
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => "rc_namespace = '0'",
+ ],
+ [
'namespace' => NS_MAIN,
'namespace' => NS_MAIN,
-
)
,
+
]
,
"rc conditions with no options (aka default setting)"
);
}
public function testRcNsFilterInversion() {
$this->assertConditions(
"rc conditions with no options (aka default setting)"
);
}
public function testRcNsFilterInversion() {
$this->assertConditions(
-
array(
# expected
+
[
# expected
'rc_bot' => 0,
'rc_bot' => 0,
- 0 => sprintf( "rc_namespace != '%s'", NS_MAIN ),
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => sprintf( "rc_namespace != '%s'", NS_MAIN ),
+ ],
+ [
'namespace' => NS_MAIN,
'invert' => 1,
'namespace' => NS_MAIN,
'invert' => 1,
-
)
,
+
]
,
"rc conditions with namespace inverted"
);
}
"rc conditions with namespace inverted"
);
}
@@
-79,14
+86,15
@@
class SpecialRecentchangesTest extends MediaWikiTestCase {
*/
public function testRcNsFilterAssociation( $ns1, $ns2 ) {
$this->assertConditions(
*/
public function testRcNsFilterAssociation( $ns1, $ns2 ) {
$this->assertConditions(
-
array(
# expected
+
[
# expected
'rc_bot' => 0,
'rc_bot' => 0,
- 0 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ),
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => sprintf( "(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ),
+ ],
+ [
'namespace' => $ns1,
'associated' => 1,
'namespace' => $ns1,
'associated' => 1,
-
)
,
+
]
,
"rc conditions with namespace inverted"
);
}
"rc conditions with namespace inverted"
);
}
@@
-97,15
+105,16
@@
class SpecialRecentchangesTest extends MediaWikiTestCase {
*/
public function testRcNsFilterAssociationWithInversion( $ns1, $ns2 ) {
$this->assertConditions(
*/
public function testRcNsFilterAssociationWithInversion( $ns1, $ns2 ) {
$this->assertConditions(
-
array(
# expected
+
[
# expected
'rc_bot' => 0,
'rc_bot' => 0,
- 0 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ),
- ),
- array(
+ 0 => "rc_type != '6'",
+ 1 => sprintf( "(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ),
+ ],
+ [
'namespace' => $ns1,
'associated' => 1,
'invert' => 1,
'namespace' => $ns1,
'associated' => 1,
'invert' => 1,
-
)
,
+
]
,
"rc conditions with namespace inverted"
);
}
"rc conditions with namespace inverted"
);
}
@@
-115,9
+124,9
@@
class SpecialRecentchangesTest extends MediaWikiTestCase {
* namespaces association filtering.
*/
public static function provideNamespacesAssociations() {
* namespaces association filtering.
*/
public static function provideNamespacesAssociations() {
- return
array(
# (NS => Associated_NS)
-
array( NS_MAIN, NS_TALK )
,
-
array( NS_TALK, NS_MAIN )
,
-
)
;
+ return
[
# (NS => Associated_NS)
+
[ NS_MAIN, NS_TALK ]
,
+
[ NS_TALK, NS_MAIN ]
,
+
]
;
}
}
}
}