76 $change->triggerCategoryAddedNotification( Title::newFromText(
'CategoryName',
NS_CATEGORY ) );
78 $this->assertEquals( 1, self::$notifyCallCounter );
80 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
81 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
82 $this->assertEquals(
'(autochange-username)', self::$lastNotifyArgs[2]->getName() );
83 $this->assertEquals(
'(recentchanges-page-added-to-category: ' . self::$pageName .
')',
84 self::$lastNotifyArgs[3] );
85 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
86 $this->assertEquals( 0, self::$lastNotifyArgs[5] );
87 $this->assertEquals( 0, self::$lastNotifyArgs[6] );
88 $this->assertEquals(
null, self::$lastNotifyArgs[7] );
89 $this->assertEquals( 1, self::$lastNotifyArgs[8] );
90 $this->assertEquals(
null, self::$lastNotifyArgs[9] );
91 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
96 $change->triggerCategoryRemovedNotification( Title::newFromText(
'CategoryName',
NS_CATEGORY ) );
98 $this->assertEquals( 1, self::$notifyCallCounter );
100 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
101 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
102 $this->assertEquals(
'(autochange-username)', self::$lastNotifyArgs[2]->getName() );
103 $this->assertEquals(
'(recentchanges-page-removed-from-category: ' . self::$pageName .
')',
104 self::$lastNotifyArgs[3] );
105 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
106 $this->assertEquals( 0, self::$lastNotifyArgs[5] );
107 $this->assertEquals( 0, self::$lastNotifyArgs[6] );
108 $this->assertEquals(
null, self::$lastNotifyArgs[7] );
109 $this->assertEquals( 1, self::$lastNotifyArgs[8] );
110 $this->assertEquals(
null, self::$lastNotifyArgs[9] );
111 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
115 $revision = Revision::newFromId( Title::newFromText( self::$pageName )->getLatestRevID() );
117 $change->triggerCategoryAddedNotification( Title::newFromText(
'CategoryName',
NS_CATEGORY ) );
119 $this->assertEquals( 1, self::$notifyCallCounter );
121 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
122 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
123 $this->assertEquals( self::$revUser->getName(), self::$lastNotifyArgs[2]->getName() );
124 $this->assertEquals(
'(recentchanges-page-added-to-category: ' . self::$pageName .
')',
125 self::$lastNotifyArgs[3] );
126 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
127 $this->assertEquals( self::$pageRev->getParentId(), self::$lastNotifyArgs[5] );
128 $this->assertEquals( $revision->getId(), self::$lastNotifyArgs[6] );
129 $this->assertEquals(
null, self::$lastNotifyArgs[7] );
130 $this->assertEquals( 0, self::$lastNotifyArgs[8] );
131 $this->assertEquals(
'127.0.0.1', self::$lastNotifyArgs[9] );
132 $this->assertEquals( 0, self::$lastNotifyArgs[10] );
136 $revision = Revision::newFromId( Title::newFromText( self::$pageName )->getLatestRevID() );
138 $change->triggerCategoryRemovedNotification( Title::newFromText(
'CategoryName',
NS_CATEGORY ) );
140 $this->assertEquals( 1, self::$notifyCallCounter );
142 $this->assertTrue( strlen( self::$lastNotifyArgs[0] ) === 14 );
143 $this->assertEquals(
'Category:CategoryName', self::$lastNotifyArgs[1]->getPrefixedText() );
144 $this->assertEquals( self::$revUser->getName(), self::$lastNotifyArgs[2]->getName() );
145 $this->assertEquals(
'(recentchanges-page-removed-from-category: ' . self::$pageName .
')',
146 self::$lastNotifyArgs[3] );
147 $this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
148 $this->assertEquals( self::$pageRev->getParentId(), self::$lastNotifyArgs[5] );
149 $this->assertEquals( $revision->getId(), self::$lastNotifyArgs[6] );
150 $this->assertEquals(
null, self::$lastNotifyArgs[7] );
151 $this->assertEquals( 0, self::$lastNotifyArgs[8] );
152 $this->assertEquals(
'127.0.0.1', self::$lastNotifyArgs[9] );
153 $this->assertEquals( 0, self::$lastNotifyArgs[10] );