16 $this->
setMwGlobals(
'wgRCWatchCategoryMembership',
true );
25 private function assertConditions( $expected, $requestOptions = null, $message =
'' ) {
32 $formOptions = $this->rc->setup( null );
34 # Filter out rc_timestamp conditions which depends on the test runtime
35 # This condition is not needed as of march 2, 2011 -- hashar
36 # @todo FIXME: Find a way to generate the correct rc_timestamp
37 $queryConditions = array_filter(
38 $this->rc->buildMainQueryConds( $formOptions ),
39 'SpecialRecentchangesTest::filterOutRcTimestampCondition'
51 return (
false === strpos( $var,
'rc_timestamp ' ) );
58 0 =>
"rc_type != '6'",
59 1 =>
"rc_namespace = '0'",
64 "rc conditions with no options (aka default setting)"
72 0 =>
"rc_type != '6'",
73 1 => sprintf(
"rc_namespace != '%s'",
NS_MAIN ),
79 "rc conditions with namespace inverted"
91 0 =>
"rc_type != '6'",
92 1 => sprintf(
"(rc_namespace = '%s' OR rc_namespace = '%s')", $ns1, $ns2 ),
98 "rc conditions with namespace inverted"
110 0 =>
"rc_type != '6'",
111 1 => sprintf(
"(rc_namespace != '%s' AND rc_namespace != '%s')", $ns1, $ns2 ),
118 "rc conditions with namespace inverted"
127 return [ # (NS => Associated_NS)
testRcNsFilterAssociation($ns1, $ns2)
static provideNamespacesAssociations()
Provides associated namespaces to test recent changes namespaces association filtering.
Group all the pieces relevant to the context of a request into one instance.
A special page that lists last changes made to the wiki.
testRcNsFilterInversion()
assertConditions($expected, $requestOptions=null, $message= '')
helper to test SpecialRecentchanges::buildMainQueryConds()
testRcNsFilterAssociationWithInversion($ns1, $ns2)
static filterOutRcTimestampCondition($var)
return false if condition begin with 'rc_timestamp '
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Test class for SpecialRecentchanges class.