!! Version 2 # Force the test runner to ensure the extension is loaded !! functionhooks af_exists !! endfunctionhooks # This file tests the #af_exists parser function !! test Test string key exists !! wikitext {{#af_exists: {{#af_object: foobar=foobar | boofar=boofar }} | foobar }} !! html
boolean__^__1
!! end !! test Test integer key exists !! wikitext {{#af_exists: {{#af_list: foobar | boofar }} | 1 }} !! htmlboolean__^__1
!! end !! test Test too few arguments !! wikitext {{#af_exists: {{#af_list: foobar | boofar }} }} !! htmlArrayFunctions (#af_exists): Expected at least 2 positional parameters, 1 given.
!! end !! test Test too many arguments !! wikitext {{#af_exists: {{#af_list: foobar | boofar }} | 1 | 2 }} !! htmlArrayFunctions (#af_exists): Expected at most 2 positional parameters, 3 given.
!! end