17 $this->
title = Title::newFromText(
'SomeTitle' );
18 $this->target = Title::newFromText(
'TestTarget' );
21 $this->user_comment =
'<User comment about action>';
22 $this->context = RequestContext::newExtraneousContext( $this->
title );
31 $actorId = $user->getActorId();
33 $row =
new stdClass();
35 $row->rc_timestamp =
'20150921134808';
36 $row->rc_deleted =
'bar';
37 $row->rc_comment_text =
'comment';
38 $row->rc_comment_data =
null;
39 $row->rc_user = $user->getId();
41 $rc = RecentChange::newFromRow( $row );
45 'rc_timestamp' =>
'20150921134808',
46 'rc_deleted' =>
'bar',
47 'rc_comment' =>
'comment',
48 'rc_comment_text' =>
'comment',
49 'rc_comment_data' =>
null,
50 'rc_user' => $user->getId(),
51 'rc_user_text' => $user->getName(),
56 $row =
new stdClass();
58 $row->rc_timestamp =
'20150921134808';
59 $row->rc_deleted =
'bar';
60 $row->rc_comment =
'comment';
61 $row->rc_user = $user->getId();
64 $rc = RecentChange::newFromRow( $row );
69 'rc_timestamp' =>
'20150921134808',
70 'rc_deleted' =>
'bar',
71 'rc_comment' =>
'comment',
72 'rc_comment_text' =>
'comment',
73 'rc_comment_data' =>
null,
74 'rc_user' => $user->getId(),
75 'rc_user_text' => $user->getName(),
94 'a:1:{s:4:"root";a:2:{s:1:"A";i:1;s:1:"B";s:3:"two";}}'
119 $rc->
setAttribs( [
'rc_params' => $rawRcParams ] );
121 $actualParseParams = $rc->parseParams();
123 $this->
assertEquals( $expectedParseParams, $actualParseParams );
131 [ 6000, -3000, 0,
true ],
132 [ 3000, -6000, 0,
false ],
133 [ 6000, -3000, 6000,
true ],
134 [ 3000, -6000, 6000,
true ],
147 $timestamp = time() + $offset;
148 $this->
assertEquals( $expected, RecentChange::isInRCLifespan( $timestamp, $tolerance ) );
182 ->disableOriginalConstructor()
198 $categoryTitle = Title::newFromText(
'CategoryPage',
NS_CATEGORY );
201 $pageProps->expects( $this->
once() )
202 ->method(
'getProperties' )
203 ->with( $categoryTitle,
'hiddencat' )
204 ->will( $this->
returnValue( $isHidden ? [ $categoryTitle->getArticleID() =>
'' ] : [] ) );
208 $rc = RecentChange::newForCategorization(
214 $categoryTitle->getLatestRevID(),
215 $categoryTitle->getLatestRevID(),
220 $this->
assertEquals( $isHidden, $rc->getParam(
'hidden-cat' ) );
222 ScopedCallback::consume( $scopedOverride );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
static overrideInstance(PageProps $store=null)
Overrides the default instance of this class This is intended for use while testing and will fail if ...
testParseFromRCType( $rcType, $type)
provideRCTypes RecentChange::parseFromRCType
testNewFromRow()
RecentChange::newFromRow RecentChange::loadFromRow.
testParseParams()
RecentChange::parseParams.
testHiddenCategoryChange( $isHidden)
provideCategoryContent RecentChange::newForCategorization
testParseToRCType( $rcType, $type)
provideRCTypes RecentChange::parseToRCType
testIsInRCLifespan( $maxAge, $offset, $tolerance, $expected)
RecentChange::isInRCLifespan provideIsInRCLifespan.
assertParseParams( $expectedParseParams, $rawRcParams)
Utility class for creating new RC entries.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
processing should stop and the error should be shown to the user * false