*/
private $testRecentChangesHelper;
- public function __construct( $name = null, array $data = array(), $dataName = '' ) {
+ public function __construct( $name = null, array $data = [], $dataName = '' ) {
parent::__construct( $name, $data, $dataName );
$this->testRecentChangesHelper = new TestRecentChangesHelper();
protected function setUp() {
parent::setUp();
- $this->setMwGlobals( array(
+ $this->setMwGlobals( [
'wgArticlePath' => '/wiki/$1'
- ) );
+ ] );
}
/**
}
public function editChangeProvider() {
- return array(
- array(
- array(
+ return [
+ [
+ [
'title' => 'Xyz',
'user' => 'TestRecentChangesUser',
- 'diff' => array( 'curid' => 5, 'diff' => 191, 'oldid' => 190 ),
- 'cur' => array( 'curid' => 5, 'diff' => 0, 'oldid' => 191 ),
+ 'diff' => [ 'curid' => 5, 'diff' => 191, 'oldid' => 190 ],
+ 'cur' => [ 'curid' => 5, 'diff' => 0, 'oldid' => 191 ],
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
- ),
+ ],
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeEditRecentChange(
0 // number of watching users
),
false
- )
- );
+ ]
+ ];
}
/**
}
public function deleteChangeProvider() {
- return array(
- array(
- array(
+ return [
+ [
+ [
'title' => 'Abc',
'user' => 'TestRecentChangesUser',
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
- ),
+ ],
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeLogRecentChange(
0 // number of watching users
),
false
- )
- );
+ ]
+ ];
}
/**
}
public function revUserDeleteProvider() {
- return array(
- array(
- array(
+ return [
+ [
+ [
'title' => 'Zzz',
'user' => 'TestRecentChangesUser',
'diff' => '',
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
- ),
+ ],
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeDeletedEditRecentChange(
0 // number of watching users
),
false
- )
- );
+ ]
+ ];
}
private function assertUserLinks( $user, $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
- 'attributes' => array(
+ 'attributes' => [
'class' => 'new mw-userlink'
- ),
+ ],
'content' => $user
- ),
+ ],
$cacheEntry->userlink,
'verify user link'
);
$this->assertTag(
- array(
+ [
'tag' => 'span',
- 'attributes' => array(
+ 'attributes' => [
'class' => 'mw-usertoollinks'
- ),
- 'child' => array(
+ ],
+ 'child' => [
'tag' => 'a',
'content' => 'talk',
- )
- ),
+ ]
+ ],
$cacheEntry->usertalklink,
'verify user talk link'
);
$this->assertTag(
- array(
+ [
'tag' => 'span',
- 'attributes' => array(
+ 'attributes' => [
'class' => 'mw-usertoollinks'
- ),
- 'child' => array(
+ ],
+ 'child' => [
'tag' => 'a',
'content' => 'contribs',
- )
- ),
+ ]
+ ],
$cacheEntry->usertalklink,
'verify user tool links'
);
private function assertDeleteLogLink( $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
- 'attributes' => array(
+ 'attributes' => [
'href' => '/wiki/Special:Log/delete',
'title' => 'Special:Log/delete'
- ),
+ ],
'content' => 'Deletion log'
- ),
+ ],
$cacheEntry->link,
'verify deletion log link'
);
private function assertRevDel( $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'span',
- 'attributes' => array(
+ 'attributes' => [
'class' => 'history-deleted'
- ),
+ ],
'content' => '(username removed)'
- ),
+ ],
$cacheEntry->userlink,
'verify user link for change with deleted revision and user'
);
private function assertTitleLink( $title, $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
- 'attributes' => array(
+ 'attributes' => [
'href' => '/wiki/' . $title,
'title' => $title
- ),
+ ],
'content' => $title
- ),
+ ],
$cacheEntry->link,
'verify title link'
);
private function assertQueryLink( $content, $params, $link ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
'content' => $content
- ),
+ ],
$link,
'assert query link element'
);
}
private function getMessages() {
- return array(
+ return [
'cur' => 'cur',
'diff' => 'diff',
'hist' => 'hist',
'history' => 'Page history',
'semicolon-separator' => '; ',
'pipe-separator' => ' | '
- );
+ ];
}
private function getTestUser() {