From 547abe3bdb71c3c99cca47be66a91593e2acf7f4 Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Tue, 2 Aug 2016 17:14:48 +0200 Subject: [PATCH] Add tests for events on multiple sections edits Mainly as preparation for future patches touching that issue. Change-Id: I80fd885cbf670e0e3252e38b85703c9d052b3056 --- tests/phpunit/DiscussionParserTest.php | 39 ++++++++++++++++++++++++ tests/phpunit/revision_txt/747798765.txt | 9 ++++++ tests/phpunit/revision_txt/747798766.txt | 19 ++++++++++++ tests/phpunit/revision_txt/747798767.txt | 25 +++++++++++++++ tests/phpunit/revision_txt/747798768.txt | 17 +++++++++++ 5 files changed, 109 insertions(+) create mode 100644 tests/phpunit/revision_txt/747798765.txt create mode 100644 tests/phpunit/revision_txt/747798766.txt create mode 100644 tests/phpunit/revision_txt/747798767.txt create mode 100644 tests/phpunit/revision_txt/747798768.txt diff --git a/tests/phpunit/DiscussionParserTest.php b/tests/phpunit/DiscussionParserTest.php index c01d32ff8..71e3f750d 100644 --- a/tests/phpunit/DiscussionParserTest.php +++ b/tests/phpunit/DiscussionParserTest.php @@ -387,6 +387,45 @@ class EchoDiscussionParserTest extends MediaWikiTestCase { ), ), ), + array( + 'new' => 747798766, + 'old' => 747798765, + 'username' => 'Admin', + 'lang' => 'en', + 'pages' => array(), + 'title' => 'UTPage', + 'expected' => array( + array( + 'type' => 'mention-failure', + 'agent' => 'Admin', + 'section-title' => 'Section 2', + ), + ), + ), + array( + 'new' => 747798767, + 'old' => 747798765, + 'username' => 'Admin', + 'lang' => 'en', + 'pages' => array(), + 'title' => 'UTPage', + 'expected' => array( + array( + 'type' => 'mention-failure', + 'agent' => 'Admin', + 'section-title' => 'Section 2', + ), + ), + ), + array( + 'new' => 747798768, + 'old' => 747798765, + 'username' => 'Admin', + 'lang' => 'en', + 'pages' => array(), + 'title' => 'UTPage', + 'expected' => array(), + ), ); } diff --git a/tests/phpunit/revision_txt/747798765.txt b/tests/phpunit/revision_txt/747798765.txt new file mode 100644 index 000000000..94c8f99b4 --- /dev/null +++ b/tests/phpunit/revision_txt/747798765.txt @@ -0,0 +1,9 @@ +Simultaneously edit multiple sections + +== Section 1 == + +Content 1 + +== Section 2 == + +Content 2 \ No newline at end of file diff --git a/tests/phpunit/revision_txt/747798766.txt b/tests/phpunit/revision_txt/747798766.txt new file mode 100644 index 000000000..99bce40cd --- /dev/null +++ b/tests/phpunit/revision_txt/747798766.txt @@ -0,0 +1,19 @@ +Simultaneously edit multiple sections + +== Section 1 == + +Content 1 + +New content with userlink ( dont try to mention this one ) + +[[User:Test11]] + +== Section 2 == + +Content 2 + +New content with userlink & signature in another section ( try to mention this one ) + +[[User:NoUser]] + +[[:User:Admin|Admin]] 13:22, 23 June 2016 (UTC) \ No newline at end of file diff --git a/tests/phpunit/revision_txt/747798767.txt b/tests/phpunit/revision_txt/747798767.txt new file mode 100644 index 000000000..26954a157 --- /dev/null +++ b/tests/phpunit/revision_txt/747798767.txt @@ -0,0 +1,25 @@ +Simultaneously edit multiple sections + +== Section 1 == + +Content 1 + +New content with userlink ( dont try to mention this one ) + +[[User:Test11]] + +== Section 1.5 == + +New section in between with userlink ( dont try to mention this one ) + +[[User:Test11]] + +== Section 2 == + +Content 2 + +New content with userlink & signature in another section ( try to mention this one ) + +[[User:NoUser]] + +[[:User:Admin|Admin]] 13:22, 23 June 2016 (UTC) \ No newline at end of file diff --git a/tests/phpunit/revision_txt/747798768.txt b/tests/phpunit/revision_txt/747798768.txt new file mode 100644 index 000000000..8569f9ef8 --- /dev/null +++ b/tests/phpunit/revision_txt/747798768.txt @@ -0,0 +1,17 @@ +Simultaneously edit multiple sections + +== Section 1 == + +Content 1 + +New content with signature + +[[:User:Admin|Admin]] 13:22, 23 June 2016 (UTC) + +== Section 2 == + +Content 2 + +New content with userlink ( dont try to mention this one ) + +[[User:Test11]] \ No newline at end of file