dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use header_register_callback to avoid caching responses with Set-Cookie headers
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
changes
/
RCCacheEntryFactoryTest.php
diff --git
a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
index
0b87727
..
602340b
100644
(file)
--- a/
tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
+++ b/
tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
@@
-14,7
+14,7
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
*/
private $testRecentChangesHelper;
*/
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();
parent::__construct( $name, $data, $dataName );
$this->testRecentChangesHelper = new TestRecentChangesHelper();
@@
-23,9
+23,9
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
protected function setUp() {
parent::setUp();
protected function setUp() {
parent::setUp();
- $this->setMwGlobals(
array(
+ $this->setMwGlobals(
[
'wgArticlePath' => '/wiki/$1'
'wgArticlePath' => '/wiki/$1'
-
)
);
+
]
);
}
/**
}
/**
@@
-56,17
+56,17
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
}
public function editChangeProvider() {
}
public function editChangeProvider() {
- return
array(
- array(
- array(
+ return
[
+ [
+ [
'title' => 'Xyz',
'user' => 'TestRecentChangesUser',
'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
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
-
)
,
+
]
,
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeEditRecentChange(
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeEditRecentChange(
@@
-80,8
+80,8
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
0 // number of watching users
),
false
0 // number of watching users
),
false
- )
-
)
;
+ ]
+
]
;
}
/**
}
/**
@@
-110,15
+110,15
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
}
public function deleteChangeProvider() {
}
public function deleteChangeProvider() {
- return
array(
- array(
- array(
+ return
[
+ [
+ [
'title' => 'Abc',
'user' => 'TestRecentChangesUser',
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
'title' => 'Abc',
'user' => 'TestRecentChangesUser',
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
-
)
,
+
]
,
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeLogRecentChange(
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeLogRecentChange(
@@
-131,8
+131,8
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
0 // number of watching users
),
false
0 // number of watching users
),
false
- )
-
)
;
+ ]
+
]
;
}
/**
}
/**
@@
-163,9
+163,9
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
}
public function revUserDeleteProvider() {
}
public function revUserDeleteProvider() {
- return
array(
- array(
- array(
+ return
[
+ [
+ [
'title' => 'Zzz',
'user' => 'TestRecentChangesUser',
'diff' => '',
'title' => 'Zzz',
'user' => 'TestRecentChangesUser',
'diff' => '',
@@
-173,7
+173,7
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
'timestamp' => '21:21',
'numberofWatchingusers' => 0,
'unpatrolled' => false
-
)
,
+
]
,
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeDeletedEditRecentChange(
$this->getContext(),
$this->getMessages(),
$this->testRecentChangesHelper->makeDeletedEditRecentChange(
@@
-187,49
+187,49
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
0 // number of watching users
),
false
0 // number of watching users
),
false
- )
-
)
;
+ ]
+
]
;
}
private function assertUserLinks( $user, $cacheEntry ) {
$this->assertTag(
}
private function assertUserLinks( $user, $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
'tag' => 'a',
- 'attributes' =>
array(
+ 'attributes' =>
[
'class' => 'new mw-userlink'
'class' => 'new mw-userlink'
-
)
,
+
]
,
'content' => $user
'content' => $user
-
)
,
+
]
,
$cacheEntry->userlink,
'verify user link'
);
$this->assertTag(
$cacheEntry->userlink,
'verify user link'
);
$this->assertTag(
- array(
+ [
'tag' => 'span',
'tag' => 'span',
- 'attributes' =>
array(
+ 'attributes' =>
[
'class' => 'mw-usertoollinks'
'class' => 'mw-usertoollinks'
-
)
,
- 'child' =>
array(
+
]
,
+ 'child' =>
[
'tag' => 'a',
'tag' => 'a',
- 'content' => '
T
alk',
- )
-
)
,
+ 'content' => '
t
alk',
+ ]
+
]
,
$cacheEntry->usertalklink,
'verify user talk link'
);
$this->assertTag(
$cacheEntry->usertalklink,
'verify user talk link'
);
$this->assertTag(
- array(
+ [
'tag' => 'span',
'tag' => 'span',
- 'attributes' =>
array(
+ 'attributes' =>
[
'class' => 'mw-usertoollinks'
'class' => 'mw-usertoollinks'
-
)
,
- 'child' =>
array(
+
]
,
+ 'child' =>
[
'tag' => 'a',
'content' => 'contribs',
'tag' => 'a',
'content' => 'contribs',
- )
-
)
,
+ ]
+
]
,
$cacheEntry->usertalklink,
'verify user tool links'
);
$cacheEntry->usertalklink,
'verify user tool links'
);
@@
-237,14
+237,14
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
private function assertDeleteLogLink( $cacheEntry ) {
$this->assertTag(
private function assertDeleteLogLink( $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
'tag' => 'a',
- 'attributes' =>
array(
+ 'attributes' =>
[
'href' => '/wiki/Special:Log/delete',
'title' => 'Special:Log/delete'
'href' => '/wiki/Special:Log/delete',
'title' => 'Special:Log/delete'
-
)
,
+
]
,
'content' => 'Deletion log'
'content' => 'Deletion log'
-
)
,
+
]
,
$cacheEntry->link,
'verify deletion log link'
);
$cacheEntry->link,
'verify deletion log link'
);
@@
-252,13
+252,13
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
private function assertRevDel( $cacheEntry ) {
$this->assertTag(
private function assertRevDel( $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'span',
'tag' => 'span',
- 'attributes' =>
array(
+ 'attributes' =>
[
'class' => 'history-deleted'
'class' => 'history-deleted'
-
)
,
+
]
,
'content' => '(username removed)'
'content' => '(username removed)'
-
)
,
+
]
,
$cacheEntry->userlink,
'verify user link for change with deleted revision and user'
);
$cacheEntry->userlink,
'verify user link for change with deleted revision and user'
);
@@
-266,14
+266,14
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
private function assertTitleLink( $title, $cacheEntry ) {
$this->assertTag(
private function assertTitleLink( $title, $cacheEntry ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
'tag' => 'a',
- 'attributes' =>
array(
+ 'attributes' =>
[
'href' => '/wiki/' . $title,
'title' => $title
'href' => '/wiki/' . $title,
'title' => $title
-
)
,
+
]
,
'content' => $title
'content' => $title
-
)
,
+
]
,
$cacheEntry->link,
'verify title link'
);
$cacheEntry->link,
'verify title link'
);
@@
-281,10
+281,10
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
private function assertQueryLink( $content, $params, $link ) {
$this->assertTag(
private function assertQueryLink( $content, $params, $link ) {
$this->assertTag(
- array(
+ [
'tag' => 'a',
'content' => $content
'tag' => 'a',
'content' => $content
-
)
,
+
]
,
$link,
'assert query link element'
);
$link,
'assert query link element'
);
@@
-295,7
+295,7
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
}
private function getMessages() {
}
private function getMessages() {
- return
array(
+ return
[
'cur' => 'cur',
'diff' => 'diff',
'hist' => 'hist',
'cur' => 'cur',
'diff' => 'diff',
'hist' => 'hist',
@@
-305,7
+305,7
@@
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
'history' => 'Page history',
'semicolon-separator' => '; ',
'pipe-separator' => ' | '
'history' => 'Page history',
'semicolon-separator' => '; ',
'pipe-separator' => ' | '
-
)
;
+
]
;
}
private function getTestUser() {
}
private function getTestUser() {