# 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
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.
!!input
category=DPLtest
!!result
!!end
!!test
basic, single category list, but ascending
!!input
order = ascending
category=DPLtest
!!result
!!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
!!input
category=DPLtest
nofollow=true
!!result
!!end
!!test
supresserrors
!!input
category=DPLtest
category=DPLtest1
category=DPLtest2
category=DPLtest3
category=DPLtest4
category=DPLtest5
category=DPLtest7
category=DPLtest6
category=DPLtest8
category=DPLtest9
category=DPLtest10
suppresserrors=true
!!result
!!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.
!!input
namespace=talk
notcategory=DPLtest3
!!result
!!end
!!test
Namespace limited to category.
!!input
category=DPLtest
namespace=talk
!!result
!!end
!!test
Namespace no category.
!!input
namespace=help
!!result
!!end
!!test
Don't show namespace name. (shownamespace=false)
!!input
namespace=help
shownamespace=false
!!result
!!end
# This one has count=1 to avoid articles from other tests.
!!test
Invalid ns treated as main namespace
!!input
namespace=Look mummy, this totally isn't a namespace
count=2
!!result
!!end
!!test
count and offset combined.
!!input
category=DPLtest
count=1
offset=1
!!result
!!end
!!test
include redirects
!!input
category=DPLtest
redirects=include
!!result
!!end
!!test
only redirect
!!input
category=DPLtest
redirects=only
!!result
!!end
# Should behave like false.
# Can't actually test true, since the date would vary.
!!test
addfirstcategorydate=INVALID
!!input
category=DPLtest
addfirstcategorydate=INVALID
!!result
!!end
!!test
addfirstcategorydate=false
!!input
category=DPLtest
addfirstcategorydate=false
!!result
!!end
!!test
mode=unordered (default)
!!input
category=DPLtest
mode=unordered
!!result
!!end
!!test
mode=INVALID
!!input
category=DPLtest
mode=INVALID
!!result
!!end
!!test
mode=ordered
!!input
category=DPLtest
mode=ordered
!!result
- Yet another DPL test page!
- Talk:DPLTest2
- DPLTest1
!!end
# This is broken
!!test
mode=none (line breaks)
!!input
category=DPLtest
mode=none
!!result
Yet another DPL test page!
Talk:DPLTest2
DPLTest1
!!end
!!test
mode=inline (comma list)
!!input
category=DPLtest
mode=inline
!!result
Yet another DPL test page!, Talk:DPLTest2, DPLTest1
!!end
# None of these are images, so crappy test.
!!test
mode=gallery (complex, no image)
!!input
category=DPLtest
imagewidth=70
galleryshowfilesize=yes
galleryshowfilename=yes
imagesperrow=7
gallerycaption=Look at my pretty gallery. {{SERVER}}
mode=gallery
!!result
- Look at my pretty gallery. http://Britney-Spears
Yet another DPL test page!
!!end
!!test
mode=gallery (simple, no image)
!!input
category=DPLtest
mode=gallery
!!result
Yet another DPL test page!
!!end
!!test
mode=gallery (complex, with image + bad image)
!!input
mode=gallery
namespace=file
addfirstcategorydate=ymd
imagewidth=70
galleryshowfilesize=yes
galleryshowfilename=yes
imagesperrow=7
gallerycaption=I love Captions
ordermethod=sortkey
order=descending
!!result
!!end
!!test
mode=gallery (simple showfilesize, no image)
!!input
category=DPLtest
mode=gallery
galleryshowfilesize=yes
galleryshowfilename=no
!!result
Yet another DPL test page!
!!end
# This is a crappy test since creation and categoryadd are the
# same for parser tests.
!!test
ordermethod=created (by article id)
!!input
category=DPLtest
ordermethod=created
!!result
!!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
!!input
category=DPLtest
ordermethod=length
!!result
!!end
!!test
ordermethod=sortkey
!!input
category=DPLtest
ordermethod=sortkey
!!result
!!end
#check to make sure the alias works.
!!test
ordermethod=categorysortkey
!!input
category=DPLtest
ordermethod=categorysortkey
order=ascending
!!result
!!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
!!input
category={{PAGENAME:DPLtest}}
!!result
!!end