summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/changes
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/includes/changes
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/includes/changes')
-rw-r--r--tests/phpunit/includes/changes/EnhancedChangesListTest.php13
-rw-r--r--tests/phpunit/includes/changes/OldChangesListTest.php1
-rw-r--r--tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php1
-rw-r--r--tests/phpunit/includes/changes/RecentChangeTest.php65
-rw-r--r--tests/phpunit/includes/changes/TestRecentChangesHelper.php1
5 files changed, 69 insertions, 12 deletions
diff --git a/tests/phpunit/includes/changes/EnhancedChangesListTest.php b/tests/phpunit/includes/changes/EnhancedChangesListTest.php
index 40a11d2d..a14a50d2 100644
--- a/tests/phpunit/includes/changes/EnhancedChangesListTest.php
+++ b/tests/phpunit/includes/changes/EnhancedChangesListTest.php
@@ -5,7 +5,6 @@
*
* @group Database
*
- * @licence GNU GPL v2+
* @author Katie Filbert < aude.wiki@gmail.com >
*/
class EnhancedChangesListTest extends MediaWikiLangTestCase {
@@ -31,7 +30,7 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
'mediawiki.special.changeslist',
$styleModules,
'has mediawiki.special.changeslist'
- );
+ );
$this->assertContains(
'mediawiki.special.changeslist.enhanced',
@@ -75,10 +74,10 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
$this->assertEquals( '', $html );
}
- /**
- * @todo more tests for actual formatting, this is more of a smoke test
- */
- public function testEndRecentChangesList() {
+ /**
+ * @todo more tests for actual formatting, this is more of a smoke test
+ */
+ public function testEndRecentChangesList() {
$enhancedChangesList = $this->newEnhancedChangesList();
$enhancedChangesList->beginRecentChangesList();
@@ -92,7 +91,7 @@ class EnhancedChangesListTest extends MediaWikiLangTestCase {
preg_match_all( '/td class="mw-enhanced-rc-nested"/', $html, $matches );
$this->assertCount( 2, $matches[0] );
- }
+ }
/**
* @return EnhancedChangesList
diff --git a/tests/phpunit/includes/changes/OldChangesListTest.php b/tests/phpunit/includes/changes/OldChangesListTest.php
index 2ea9f33e..311ad89c 100644
--- a/tests/phpunit/includes/changes/OldChangesListTest.php
+++ b/tests/phpunit/includes/changes/OldChangesListTest.php
@@ -9,7 +9,6 @@
*
* @group Database
*
- * @licence GNU GPL v2+
* @author Katie Filbert < aude.wiki@gmail.com >
*/
class OldChangesListTest extends MediaWikiLangTestCase {
diff --git a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
index ee1a4d0e..0b877275 100644
--- a/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
+++ b/tests/phpunit/includes/changes/RCCacheEntryFactoryTest.php
@@ -5,7 +5,6 @@
*
* @group Database
*
- * @licence GNU GPL v2+
* @author Katie Filbert < aude.wiki@gmail.com >
*/
class RCCacheEntryFactoryTest extends MediaWikiLangTestCase {
diff --git a/tests/phpunit/includes/changes/RecentChangeTest.php b/tests/phpunit/includes/changes/RecentChangeTest.php
index 98903f1e..b3cb7b52 100644
--- a/tests/phpunit/includes/changes/RecentChangeTest.php
+++ b/tests/phpunit/includes/changes/RecentChangeTest.php
@@ -35,6 +35,7 @@ class RecentChangeTest extends MediaWikiTestCase {
* Should cover the following log actions (which are most commonly used by bots):
* - block/block
* - block/unblock
+ * - block/reblock
* - delete/delete
* - delete/restore
* - newusers/create
@@ -46,6 +47,9 @@ class RecentChangeTest extends MediaWikiTestCase {
* - protect/modifyprotect
* - protect/unprotect
* - upload/upload
+ * - merge/merge
+ * - import/upload
+ * - import/interwiki
*
* As well as the following Auto Edit Summaries:
* - blank
@@ -62,9 +66,13 @@ class RecentChangeTest extends MediaWikiTestCase {
# block/block
$this->assertIRCComment(
- $this->context->msg( 'blocklogentry', 'SomeTitle' )->plain() . $sep . $this->user_comment,
+ $this->context->msg( 'blocklogentry', 'SomeTitle', 'duration', '(flags)' )->plain()
+ . $sep . $this->user_comment,
'block', 'block',
- array(),
+ array(
+ '5::duration' => 'duration',
+ '6::flags' => 'flags',
+ ),
$this->user_comment
);
# block/unblock
@@ -74,6 +82,17 @@ class RecentChangeTest extends MediaWikiTestCase {
array(),
$this->user_comment
);
+ # block/reblock
+ $this->assertIRCComment(
+ $this->context->msg( 'reblock-logentry', 'SomeTitle', 'duration', '(flags)' )->plain()
+ . $sep . $this->user_comment,
+ 'block', 'reblock',
+ array(
+ '5::duration' => 'duration',
+ '6::flags' => 'flags',
+ ),
+ $this->user_comment
+ );
}
/**
@@ -230,6 +249,48 @@ class RecentChangeTest extends MediaWikiTestCase {
}
/**
+ * @covers LogFormatter::getIRCActionText
+ */
+ public function testIrcMsgForLogTypeMerge() {
+ $sep = $this->context->msg( 'colon-separator' )->text();
+
+ # merge/merge
+ $this->assertIRCComment(
+ $this->context->msg( 'pagemerge-logentry', 'SomeTitle', 'Dest', 'timestamp' )->plain()
+ . $sep . $this->user_comment,
+ 'merge', 'merge',
+ array(
+ '4::dest' => 'Dest',
+ '5::mergepoint' => 'timestamp',
+ ),
+ $this->user_comment
+ );
+ }
+
+ /**
+ * @covers LogFormatter::getIRCActionText
+ */
+ public function testIrcMsgForLogTypeImport() {
+ $sep = $this->context->msg( 'colon-separator' )->text();
+
+ # import/upload
+ $this->assertIRCComment(
+ $this->context->msg( 'import-logentry-upload', 'SomeTitle' )->plain() . $sep . $this->user_comment,
+ 'import', 'upload',
+ array(),
+ $this->user_comment
+ );
+
+ # import/interwiki
+ $this->assertIRCComment(
+ $this->context->msg( 'import-logentry-interwiki', 'SomeTitle' )->plain() . $sep . $this->user_comment,
+ 'import', 'interwiki',
+ array(),
+ $this->user_comment
+ );
+ }
+
+ /**
* @todo Emulate these edits somehow and extract
* raw edit summary from RecentChange object
* --
diff --git a/tests/phpunit/includes/changes/TestRecentChangesHelper.php b/tests/phpunit/includes/changes/TestRecentChangesHelper.php
index ad643274..2506087b 100644
--- a/tests/phpunit/includes/changes/TestRecentChangesHelper.php
+++ b/tests/phpunit/includes/changes/TestRecentChangesHelper.php
@@ -3,7 +3,6 @@
/**
* Helper for generating test recent changes entries.
*
- * @licence GNU GPL v2+
* @author Katie Filbert < aude.wiki@gmail.com >
*/
class TestRecentChangesHelper {