r83621 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83620‎ | r83621 | r83622 >
Date:00:29, 10 March 2011
Author:bawolff
Status:ok
Tags:
Comment:
(follow-up r83433) Fix (or workaround) bug discovered with mode=none having <pre>'s inserted (root cause is bug 1319)

Fix up the tests I added. Some of them were testing stuff thats not going to work
(such as the addfirstcategorydate, since the date is going to change from day to day. d'oh).
Remove the one whitespace before the li on all these tests (for the pre issue). And add one more test.
Modified paths:
  • /trunk/extensions/intersection/DynamicPageList.php (modified) (history)
  • /trunk/extensions/intersection/DynamicPageList.tests.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/intersection/DynamicPageList.php
@@ -642,7 +642,7 @@
643643 if ( $inlineMode ) {
644644 $output .= $wgContLang->commaList( $articleList );
645645 } else {
646 - $output .= implode( "$endItem \n $startItem", $articleList );
 646+ $output .= implode( "$endItem \n$startItem", $articleList );
647647 }
648648 $output .= $endItem;
649649 $output .= $endList . "\n";
Index: trunk/extensions/intersection/DynamicPageList.tests.txt
@@ -15,6 +15,7 @@
1616 ## varries depending on today's date.
1717 ## *gallery stuff (lack of images)
1818 ## *some order methods, due to lack of flexibity in page creation
 19+## googlehack (dpl_id) stuff because page_id changes depending on other tests.
1920
2021 !! article
2122 DPLTest1
@@ -68,8 +69,8 @@
6970 !!result
7071 <ul>
7172 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
72 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
73 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 73+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 74+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
7475
7576 !!end
7677
@@ -84,30 +85,32 @@
8586 !!result
8687 <ul>
8788 <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li>
88 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
89 - <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li></ul>
 89+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 90+<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li></ul>
9091
9192 !!end
9293
9394 # Depnds on page id of other pages
9495 # so could break depending on other tests
9596 # if they get different page id
96 -!!test
97 -dpl_id
98 -!!input
99 -<DynamicPageList>
100 -category=DPLtest
101 -googlehack=true
102 -</DynamicPageList>
103 -!!result
104 -<ul>
105 -<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!?dpl_id=53">Yet another DPL test page!</a></li>
106 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2?dpl_id=51">Talk:DPLTest2</a></li>
107 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1?dpl_id=50">DPLTest1</a></li></ul>
 97+#
 98+# Low and behold that actually does happen. Commenting out.
 99+#!!test
 100+#dpl_id
 101+#!!input
 102+#<DynamicPageList>
 103+#category=DPLtest
 104+#googlehack=true
 105+#</DynamicPageList>
 106+#!!result
 107+#<ul>
 108+#<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!?dpl_id=53">Yet another DPL test page!</a></li>
 109+#<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2?dpl_id=51">Talk:DPLTest2</a></li>
 110+#<li><a href="https://www.mediawiki.org/wiki/DPLTest1?dpl_id=50">DPLTest1</a></li></ul>
 111+#
 112+#!!end
108113
109 -!!end
110114
111 -
112115 !!test
113116 nofollow
114117 !!input
@@ -118,8 +121,8 @@
119122 !!result
120123 <ul>
121124 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!" rel="nofollow">Yet another DPL test page!</a></li>
122 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2" rel="nofollow">Talk:DPLTest2</a></li>
123 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1" rel="nofollow">DPLTest1</a></li></ul>
 125+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2" rel="nofollow">Talk:DPLTest2</a></li>
 126+<li><a href="https://www.mediawiki.org/wiki/DPLTest1" rel="nofollow">DPLTest1</a></li></ul>
124127
125128 !!end
126129
@@ -237,7 +240,7 @@
238241 !!result
239242 <ul>
240243 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
241 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 244+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
242245
243246 !!end
244247
@@ -265,9 +268,9 @@
266269 !!result
267270 <ul>
268271 <li><a href="https://www.mediawiki.org/wiki/DPLRedir" class="mw-redirect">DPLRedir</a></li>
269 - <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
270 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
271 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 272+<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
 273+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 274+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
272275
273276 !!end
274277
@@ -297,8 +300,8 @@
298301 !!result
299302 <ul>
300303 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
301 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
302 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 304+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 305+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
303306
304307 !!end
305308
@@ -312,8 +315,8 @@
313316 !!result
314317 <ul>
315318 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
316 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
317 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 319+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 320+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
318321
319322 !!end
320323
@@ -328,8 +331,8 @@
329332 !!result
330333 <ul>
331334 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
332 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
333 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 335+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 336+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
334337
335338 !!end
336339 !!test
@@ -342,8 +345,8 @@
343346 !!result
344347 <ul>
345348 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
346 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
347 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 349+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 350+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
348351
349352 !!end
350353
@@ -357,8 +360,8 @@
358361 !!result
359362 <ol>
360363 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
361 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
362 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ol>
 364+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 365+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ol>
363366
364367 !!end
365368
@@ -371,10 +374,10 @@
372375 mode=none
373376 </DynamicPageList>
374377 !!result
375 -<a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a><br />
 378+<p><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a><br />
376379 <a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a><br />
377380 <a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a><br />
378 -
 381+</p>
379382 !!end
380383
381384 !!test
@@ -395,7 +398,6 @@
396399 !!input
397400 <DynamicPageList>
398401 category=DPLtest
399 -addfirstcategorydate=ymd
400402 imagewidth=70
401403 galleryshowfilesize=yes
402404 galleryshowfilename=yes
@@ -410,7 +412,7 @@
411413 <div style="height: 150px;">Yet another DPL test page!</div>
412414 <div class="gallerytext">
413415 <p><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!" title="Yet another DPL test page!">Yet another DPL test...</a><br />
414 -<span class="mw-formatted-date" title="2011-03-07">2011 March 7</span> File missing<br />
 416+File missing<br />
415417 </p>
416418 </div>
417419 </div></li>
@@ -418,7 +420,7 @@
419421 <div style="height: 150px;">DPLTest2</div>
420422 <div class="gallerytext">
421423 <p><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2" title="Talk:DPLTest2">DPLTest2</a><br />
422 -<span class="mw-formatted-date" title="2011-03-07">2011 March 7</span> File missing<br />
 424+File missing<br />
423425 </p>
424426 </div>
425427 </div></li>
@@ -426,7 +428,7 @@
427429 <div style="height: 150px;">DPLTest1</div>
428430 <div class="gallerytext">
429431 <p><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a><br />
430 -<span class="mw-formatted-date" title="2011-03-07">2011 March 7</span> File missing<br />
 432+File missing<br />
431433 </p>
432434 </div>
433435 </div></li>
@@ -555,8 +557,8 @@
556558 !!result
557559 <ul>
558560 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
559 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
560 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 561+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 562+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
561563
562564 !!end
563565
@@ -589,8 +591,8 @@
590592 !!result
591593 <ul>
592594 <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
593 - <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
594 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 595+<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
 596+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
595597
596598 !!end
597599
@@ -604,8 +606,8 @@
605607 !!result
606608 <ul>
607609 <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
608 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
609 - <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 610+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 611+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
610612
611613 !!end
612614
@@ -621,8 +623,27 @@
622624 !!result
623625 <ul>
624626 <li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li>
625 - <li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
626 - <li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li></ul>
 627+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 628+<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li></ul>
627629
628630 !!end
629631
 632+# Check {{PAGENAME}} in category clause (dates variables are somewhat more common, but
 633+# this is easier to check.
 634+#
 635+# using {{PAGENAME:DPLtest}} because dpl uses a weird (and probably wrong way) of
 636+# expanding {{PAGENAME}} and friends, which doesn't work with parsertests and
 637+# the title= option.
 638+!!test
 639+Magic word in category clause
 640+!!input
 641+<DynamicPageList>
 642+category={{PAGENAME:DPLtest}}
 643+</DynamicPageList>
 644+!!result
 645+<ul>
 646+<li><a href="https://www.mediawiki.org/wiki/Yet_another_DPL_test_page!">Yet another DPL test page!</a></li>
 647+<li><a href="https://www.mediawiki.org/wiki/Talk:DPLTest2">Talk:DPLTest2</a></li>
 648+<li><a href="https://www.mediawiki.org/wiki/DPLTest1">DPLTest1</a></li></ul>
 649+
 650+!!end

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83433Add parser tests to this extension....bawolff03:41, 7 March 2011

Status & tagging log