From 1f76199ed848f19e8e26f4bcad9cc42ed8969aaa Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Tue, 17 Dec 2019 15:51:41 +0100 Subject: [PATCH] =?UTF-8?q?Add=20parser=20tests=20for=20the=20responsive?= =?UTF-8?q?=3D"=E2=80=A6"=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id9d733dabf82f2c26f51c6fbd1e03fe0574e88a8 --- src/Cite.php | 1 - tests/parser/responsiveReferences.txt | 173 ++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 tests/parser/responsiveReferences.txt diff --git a/src/Cite.php b/src/Cite.php index efc50faa5..fe6ff4aba 100644 --- a/src/Cite.php +++ b/src/Cite.php @@ -498,7 +498,6 @@ class Cite { return $this->referencesFormatter->formatReferences( $parser, $this->referenceStack->popGroup( $group ), - // FIXME: The responsive feature is not covered by parser tests! (bool)( $responsive ?? $wgCiteResponsiveReferences ), $this->isSectionPreview ); diff --git a/tests/parser/responsiveReferences.txt b/tests/parser/responsiveReferences.txt new file mode 100644 index 000000000..04387d1a9 --- /dev/null +++ b/tests/parser/responsiveReferences.txt @@ -0,0 +1,173 @@ +!! test +Ordered lists directly following each other should not be merged +!! config +wgCiteResponsiveReferences=false +!! wikitext +reference text +# content list item + +!! html/php +

[1] +

+
  1. content list item
+
    +
  1. reference text +
  2. +
+!! end + +!! test +Enabling responsive references by default should add a
wrapper +!! config +wgCiteResponsiveReferences=true +!! wikitext +a + +!! html/php +

[1] +

+
    +
  1. a +
  2. +
+!! end + +!! test +Enabling responsive references in the tag should add a
wrapper +!! config +wgCiteResponsiveReferences=false +!! wikitext +a + +!! html/php +

[1] +

+
    +
  1. a +
  2. +
+!! end + +!! test +Disabling responsive references in the tag should remove the
wrapper +!! config +wgCiteResponsiveReferences=true +!! wikitext +a + +!! html/php +

[1] +

+
    +
  1. a +
  2. +
+!! end + +!! test +9 references should *not* enable the column mode +!! config +wgCiteResponsiveReferences=true +!! wikitext +a +a +a +a +a +a +a +a +a +a + +!! html/php +

[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10] +

+
    +
  1. a +
  2. +
  3. a +
  4. +
  5. a +
  6. +
  7. a +
  8. +
  9. a +
  10. +
  11. a +
  12. +
  13. a +
  14. +
  15. a +
  16. +
  17. a +
  18. +
  19. a +
  20. +
+!! end + +!! test +10 references should enable the column mode +!! config +wgCiteResponsiveReferences=true +!! wikitext +a +a +a +a +a +a +a +a +a +a +a + +!! html/php +

[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10] +[11] +

+
    +
  1. a +
  2. +
  3. a +
  4. +
  5. a +
  6. +
  7. a +
  8. +
  9. a +
  10. +
  11. a +
  12. +
  13. a +
  14. +
  15. a +
  16. +
  17. a +
  18. +
  19. a +
  20. +
  21. a +
  22. +
+!! end