Page MenuHomePhabricator

phpunit failure: Pages::testParserTest: Failed asserting that two strings are equal.
Closed, InvalidPublic

Description

Apparently they all have some unexpected "pagequality" class, at least when run with other extensions (http://paste.debian.net/111811/).

  1. Pages::testParserTest with data set #2 ('pages: without file: Simple transclusion', '<pages index="Test" from="Test 1.jpg" to="Test 3.png" />', '<div>

<p><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;<span><a href="/wiki/Page:Test_3.png" title="Page:Test 3.png">2</a></span>
</p><p>Test 3&#32;
</p>
</div>
', '', '')
pages: without file: Simple transclusion
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
-<p><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;<span><a href="/wiki/Page:Test_3.png" title="Page:Test 3.png">2</a></span>
+<p><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg" class="prp-pagequality-1">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff" class="prp-pagequality-1">1</a></span>Test 2&#32;<span><a href="/wiki/Page:Test_3.png" title="Page:Test 3.png" class="prp-pagequality-1">2</a></span>
</p><p>Test 3&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. Pages::testParserTest with data set #3 ('pages: without file: Simple transclusion without from', '<pages index="Test" to="Test 2.tiff" />', '<div>

<p><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;
</p>
</div>
', '', '')
pages: without file: Simple transclusion without from
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
-<p><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;
+<p><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg" class="prp-pagequality-1">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff" class="prp-pagequality-1">1</a></span>Test 2&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. Pages::testParserTest with data set #4 ('pages: without file: Simple transclusion without to', '<pages index="Test" from="Test 2.tiff" />', '<div>

<p><span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;<span><a href="/wiki/Page:Test_3.png" title="Page:Test 3.png">2</a></span>
</p><p>Test 3&#32;
</p>
</div>
', '', '')
pages: without file: Simple transclusion without to
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
-<p><span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;<span><a href="/wiki/Page:Test_3.png" title="Page:Test 3.png">2</a></span>
+<p><span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff" class="prp-pagequality-1">1</a></span>Test 2&#32;<span><a href="/wiki/Page:Test_3.png" title="Page:Test 3.png" class="prp-pagequality-1">2</a></span>
</p><p>Test 3&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. Pages::testParserTest with data set #5 ('pages: without file: Header', '<pages index="Test" from="Test 1.jpg" to="Test 2.tiff" header=1 />', '<div>

<p>Title -- <a href="/wiki/Author:Me" title="Author:Me">Author:Me</a>
TOC -- 1
<a href="/wiki/Test/Chapter_1" title="Test/Chapter 1">Test/Chapter 1</a> -- <a href="/wiki/Test/Chapter_3" title="Test/Chapter 3">Chapter 3</a><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;
</p>
</div>
', 'title="Test/Chapter 2"', '')
pages: without file: Header
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
<p>Title -- <a href="/wiki/Author:Me" title="Author:Me">Author:Me</a>
TOC -- 1
-<a href="/wiki/Test/Chapter_1" title="Test/Chapter 1">Test/Chapter 1</a> -- <a href="/wiki/Test/Chapter_3" title="Test/Chapter 3">Chapter 3</a><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff">1</a></span>Test 2&#32;
+<a href="/wiki/Test/Chapter_1" title="Test/Chapter 1">Test/Chapter 1</a> -- <a href="/wiki/Test/Chapter_3" title="Test/Chapter 3">Chapter 3</a><span><a href="/wiki/Page:Test_1.jpg" title="Page:Test 1.jpg" class="prp-pagequality-1">TOC</a></span>Test 1&#32;<span><a href="/wiki/Page:Test_2.tiff" title="Page:Test 2.tiff" class="prp-pagequality-1">1</a></span>Test 2&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. Pages::testParserTest with data set #21 ('pages: fromsection', '<pages index="TestSection" from="TestSection 1" fromsection="Foo" to="TestSection 3" />', '<div>

<p><span><a href="/wiki/Page:TestSection_1" title="Page:TestSection 1">TOC</a></span>
Test 11
</p><p>Test 12&#32;<span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2">1</a></span>Test 20
</p><p>Test 21
</p><p>Test 22&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3">2</a></span>Test 30
</p><p>Test 31
</p><p>Test 32&#32;
</p>
</div>
', '', '')
pages: fromsection
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
-<p><span><a href="/wiki/Page:TestSection_1" title="Page:TestSection 1">TOC</a></span>
+<p><span><a href="/wiki/Page:TestSection_1" title="Page:TestSection 1" class="prp-pagequality-1">TOC</a></span>
Test 11
-</p><p>Test 12&#32;<span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2">1</a></span>Test 20
+</p><p>Test 12&#32;<span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2" class="prp-pagequality-1">1</a></span>Test 20
</p><p>Test 21
-</p><p>Test 22&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3">2</a></span>Test 30
+</p><p>Test 22&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3" class="prp-pagequality-1">2</a></span>Test 30
</p><p>Test 31
</p><p>Test 32&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. Pages::testParserTest with data set #22 ('pages: tosection', '<pages index="TestSection" from="TestSection 2" to="TestSection 3" tosection="Bar" />', '<div>

<p><span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2">1</a></span>Test 20
</p><p>Test 21
</p><p>Test 22&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3">2</a></span>Test 30
</p><p>Test 31
&#32;
</p>
</div>
', '', '')
pages: tosection
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
-<p><span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2">1</a></span>Test 20
+<p><span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2" class="prp-pagequality-1">1</a></span>Test 20
</p><p>Test 21
-</p><p>Test 22&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3">2</a></span>Test 30
+</p><p>Test 22&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3" class="prp-pagequality-1">2</a></span>Test 30
</p><p>Test 31
&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160

  1. Pages::testParserTest with data set #23 ('pages: onlysection', '<pages index="TestSection" from="TestSection 1" to="TestSection 3" onlysection="Foo" />', '<div>

<p><span><a href="/wiki/Page:TestSection_1" title="Page:TestSection 1">TOC</a></span>
Test 11
&#32;<span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2">1</a></span>
Test 21
&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3">2</a></span>&#32;
</p>
</div>
', '', '')
pages: onlysection
Failed asserting that two strings are equal.

  • Expected

+++ Actual
@@ @@
'<div>
-<p><span><a href="/wiki/Page:TestSection_1" title="Page:TestSection 1">TOC</a></span>
+<p><span><a href="/wiki/Page:TestSection_1" title="Page:TestSection 1" class="prp-pagequality-1">TOC</a></span>
Test 11
-&#32;<span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2">1</a></span>
+&#32;<span><a href="/wiki/Page:TestSection_2" title="Page:TestSection 2" class="prp-pagequality-1">1</a></span>
Test 21
-&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3">2</a></span>&#32;
+&#32;<span><a href="/wiki/Page:TestSection_3" title="Page:TestSection 3" class="prp-pagequality-1">2</a></span>&#32;
</p>
</div>
'

/srv/vagrant/mediawiki/tests/phpunit/includes/parser/NewParserTest.php:767
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160


Version: unspecified
Severity: normal

Details

Reference
bz68644

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:38 AM
bzimport added a project: ProofreadPage.
bzimport set Reference to bz68644.
bzimport added a subscriber: Unknown Object (MLST).

Change 150226 had a related patch set uploaded by Hashar:
Always set prquality even if $wgTitle does not exist

https://gerrit.wikimedia.org/r/150226

Change 150226 abandoned by Hashar:
Always set prquality even if $wgTitle does not exist

https://gerrit.wikimedia.org/r/150226

Tpt claimed this task.

I don't think this issue should be solved: ProofreadPage adds this class to all links to Page: namespace and make these tests pass would mean to have a specific case in the code for unit tests.

Feel free to reopen it if you think so.

Well, this is a common issue with such parser test, seen in particular with the <gallery> tag. The only solutions to make the tests pass together are quite ugly.