35 private static $pageName =
'CategoryMembershipChangeTestPage';
38 self::$lastNotifyArgs = func_get_args();
39 self::$notifyCallCounter += 1;
40 return self::$mockRecentChange;
45 self::$notifyCallCounter = 0;
46 self::$mockRecentChange = self::getMock(
'RecentChange' );
56 self::$pageRev =
$page->getRevision();
61 $change->overrideNewForCategorizationCallback(
62 'CategoryMembershipChangeTest::newForCategorizationCallback'
72 $this->assertEquals( 1, self::$notifyCallCounter );
74 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
75 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
76 $this->assertEquals(
'(autochange-username)', self::$lastNotifyArgs[2]->getName() );
77 $this->assertEquals(
'(recentchanges-page-added-to-category: ' . self::$pageName .
')',
78 self::$lastNotifyArgs[3] );
79 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
80 $this->assertEquals( 0, self::$lastNotifyArgs[5] );
81 $this->assertEquals( 0, self::$lastNotifyArgs[6] );
82 $this->assertEquals( null, self::$lastNotifyArgs[7] );
83 $this->assertEquals( 1, self::$lastNotifyArgs[8] );
84 $this->assertEquals( null, self::$lastNotifyArgs[9] );
85 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
92 $this->assertEquals( 1, self::$notifyCallCounter );
94 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
95 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
96 $this->assertEquals(
'(autochange-username)', self::$lastNotifyArgs[2]->getName() );
97 $this->assertEquals(
'(recentchanges-page-removed-from-category: ' . self::$pageName .
')',
98 self::$lastNotifyArgs[3] );
99 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
100 $this->assertEquals( 0, self::$lastNotifyArgs[5] );
101 $this->assertEquals( 0, self::$lastNotifyArgs[6] );
102 $this->assertEquals( null, self::$lastNotifyArgs[7] );
103 $this->assertEquals( 1, self::$lastNotifyArgs[8] );
104 $this->assertEquals( null, self::$lastNotifyArgs[9] );
105 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
113 $this->assertEquals( 1, self::$notifyCallCounter );
115 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
116 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
117 $this->assertEquals(
'UTSysop', self::$lastNotifyArgs[2]->getName() );
118 $this->assertEquals(
'(recentchanges-page-added-to-category: ' . self::$pageName .
')',
119 self::$lastNotifyArgs[3] );
120 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
121 $this->assertEquals( self::$pageRev->getParentId(), self::$lastNotifyArgs[5] );
122 $this->assertEquals( $revision->getId(), self::$lastNotifyArgs[6] );
123 $this->assertEquals( null, self::$lastNotifyArgs[7] );
124 $this->assertEquals( 0, self::$lastNotifyArgs[8] );
125 $this->assertEquals(
'127.0.0.1', self::$lastNotifyArgs[9] );
126 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
134 $this->assertEquals( 1, self::$notifyCallCounter );
136 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
137 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
138 $this->assertEquals(
'UTSysop', self::$lastNotifyArgs[2]->getName() );
139 $this->assertEquals(
'(recentchanges-page-removed-from-category: ' . self::$pageName .
')',
140 self::$lastNotifyArgs[3] );
141 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
142 $this->assertEquals( self::$pageRev->getParentId(), self::$lastNotifyArgs[5] );
143 $this->assertEquals( $revision->getId(), self::$lastNotifyArgs[6] );
144 $this->assertEquals( null, self::$lastNotifyArgs[7] );
145 $this->assertEquals( 0, self::$lastNotifyArgs[8] );
146 $this->assertEquals(
'127.0.0.1', self::$lastNotifyArgs[9] );
147 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
newChange(Revision $revision=null)
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static newForCategorizationCallback()
CategoryMembershipChange.
testChangeRemovedWithRev()
static RecentChange $mockRecentChange
static int $notifyCallCounter
static array Title[] User[] $lastNotifyArgs
namespace and then decline to actually register it file or subcat img or subcat $title
static newFromId($id, $flags=0)
Load a page revision from a given revision ID number.
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
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page