!! Version 2 ###################################################### #### Warning: run these tests via parserTests.php # #### # #### These tests tend to fail when run from phpunit. # ###################################################### # Not clear if this does anything, but other extension do it. # However, seems to make this not work, so commenting out for now. #!! hooks #DynamicPageList #!! endhooks # Some of these might fail if some other # extension adds articles to the tests, which is bad. # Things not tested: ## *Flagged revs related props ## *Actual intersection (multiple notcategory/category clauses) ## due to issue with mysql self-joins on temp tables. ## *Date related things (Addcategorydate) since the output ## varries depending on today's date. ## *gallery stuff (lack of images) ## *some order methods, due to lack of flexibity in page creation ## googlehack (dpl_id) stuff because page_id changes depending on other tests. !! article MediaWiki:Bad_image_list !! text * [[:File:Bad.jpg]] except [[Nasty page]] !! endarticle !! article DPLTest1 !! text [[category:DPLtest]] !! endarticle !! article Talk:DPLTest2 !! text [[category:DPLtest]] [[category:DPLtest3]] [[category:DPLtest2]] !! endarticle !! article Talk:no_Categories !! text no cats !! endarticle !! article Yet another DPL test page! !! text [[category:DPLtest]] [[category:DPLtest2]] !! endarticle !! article help:DPLTest3 !! text Article. [[category:DPLtest2]] !! endarticle !! article DPLRedir !! text #Redirect[[DPLtest]] [[category:DPLtest]] !! endarticle # start actual tests. !! test basic, single category list, ordered by cat add, desc. !! wikitext category=DPLtest !! html !! end !! test basic, single category list, but ascending !! wikitext order = ascending category=DPLtest !! html !! end # Depnds on page id of other pages # so could break depending on other tests # if they get different page id # # Low and behold that actually does happen. Commenting out. #!!test #dpl_id #!!input # #category=DPLtest #googlehack=true # #!!result # # #!!end !! test nofollow !! wikitext category=DPLtest nofollow=true !! html !! end !! test supresserrors !! wikitext category=DPLtest category=DPLtest1 category=DPLtest2 category=DPLtest3 category=DPLtest4 category=DPLtest5 category=DPLtest7 category=DPLtest6 category=DPLtest8 category=DPLtest9 category=DPLtest10 suppresserrors=true !! html !! end ## BROKEN!! mysql doesn't like using self-joins on temporary tables ## which breaks this test. #!!test #Intersection. #!!input # #category=DPLtest #category=DPLtest2 # #!!result # # #!!end ## BROKEN!! (same as above) #!!test #Intersection and negation. #!!input # #category=DPLtest #category=DPLtest2 #notcategory=DPLtest3 # #!!result # # #!!end !! test Negation with namespace. !! wikitext namespace=talk notcategory=DPLtest3 !! html !! end !! test Namespace limited to category. !! wikitext category=DPLtest namespace=talk !! html !! end !! test Namespace no category. !! wikitext namespace=help !! html !! end !! test Don't show namespace name. (shownamespace=false) !! wikitext namespace=help shownamespace=false !! html !! end # This one has count=1 to avoid articles from other tests. !! test Invalid ns treated as main namespace !! wikitext namespace=Look mummy, this totally isn't a namespace count=2 !! html !! end !! test count and offset combined. !! wikitext category=DPLtest count=1 offset=1 !! html !! end !! test include redirects !! wikitext category=DPLtest redirects=include !! html !! end !! test only redirect !! wikitext category=DPLtest redirects=only !! html !! end # Should behave like false. # Can't actually test true, since the date would vary. !! test addfirstcategorydate=INVALID !! wikitext category=DPLtest addfirstcategorydate=INVALID !! html !! end !! test addfirstcategorydate=false !! wikitext category=DPLtest addfirstcategorydate=false !! html !! end !! test mode=unordered (default) !! wikitext category=DPLtest mode=unordered !! html !! end !! test mode=INVALID !! wikitext category=DPLtest mode=INVALID !! html !! end !! test mode=ordered !! wikitext category=DPLtest mode=ordered !! html
  1. Yet another DPL test page!
  2. Talk:DPLTest2
  3. DPLTest1
!! end # This is broken !! test mode=none (line breaks) !! wikitext category=DPLtest mode=none !! html

Yet another DPL test page!
Talk:DPLTest2
DPLTest1

!! end !! test mode=inline (comma list) !! wikitext category=DPLtest mode=inline !! html

Yet another DPL test page!, Talk:DPLTest2, DPLTest1

!! end # None of these are images, so crappy test. !! test mode=gallery (complex, no image) !! wikitext category=DPLtest imagewidth=70 galleryshowfilesize=yes galleryshowfilename=yes imagesperrow=7 gallerycaption=Look at my pretty gallery. {{SERVER}} mode=gallery !! html !! end !! test mode=gallery (simple, no image) !! wikitext category=DPLtest mode=gallery !! html !! end !! test mode=gallery (complex, with image + bad image) !! wikitext mode=gallery namespace=file addfirstcategorydate=ymd imagewidth=70 galleryshowfilesize=yes galleryshowfilename=yes imagesperrow=7 gallerycaption=I love Captions ordermethod=sortkey order=descending !! html !! end !! test mode=gallery (simple showfilesize, no image) !! wikitext category=DPLtest mode=gallery galleryshowfilesize=yes galleryshowfilename=no !! html !! end # This is a crappy test since creation and categoryadd are the # same for parser tests. !! test ordermethod=created (by article id) !! wikitext category=DPLtest ordermethod=created !! html !! end # This one is BROKEN! I'm not sure why. # Seems to order it in opposite order. Maybe timestamp isn't # fine grained enough or something given how parsertests creates them. #!!test #ordermethod=lastedit (by page_touched) #!!input # #category=DPLtest #ordermethod=lastedit # #!!result # # #!!end !! test ordermethod=length !! wikitext category=DPLtest ordermethod=length !! html !! end !! test ordermethod=sortkey !! wikitext category=DPLtest ordermethod=sortkey !! html !! end #check to make sure the alias works. !! test ordermethod=categorysortkey !! wikitext category=DPLtest ordermethod=categorysortkey order=ascending !! html !! end # Check {{PAGENAME}} in category clause (dates variables are somewhat more common, but # this is easier to check. # # using {{PAGENAME:DPLtest}} because dpl uses a weird (and probably wrong way) of # expanding {{PAGENAME}} and friends, which doesn't work with parsertests and # the title= option. !! test Magic word in category clause !! wikitext category={{PAGENAME:DPLtest}} !! html !! end