Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixing broken tests -_-;

  • Loading branch information...
commit 6cba87360fc53d0cc94ca2206c1fc652dcf489d3 1 parent 13c5e7b
John Boehr authored

Showing 113 changed files with 0 additions and 3,077 deletions. Show diff stats Hide diff stats

  1. +0 24 tests/mustache-spec-comment-indented-inline.phpt
  2. +0 29 tests/mustache-spec-comment-indented-multiline-standalone.phpt
  3. +0 27 tests/mustache-spec-comment-indented-standalone.phpt
  4. +0 22 tests/mustache-spec-comment-inline.phpt
  5. +0 29 tests/mustache-spec-comment-multiline-standalone.phpt
  6. +0 27 tests/mustache-spec-comment-multiline.phpt
  7. +0 25 tests/mustache-spec-comment-standalone-line-endings.phpt
  8. +0 24 tests/mustache-spec-comment-standalone-without-newline.phpt
  9. +0 23 tests/mustache-spec-comment-standalone-without-previous-line.phpt
  10. +0 27 tests/mustache-spec-comment-standalone.phpt
  11. +0 22 tests/mustache-spec-comment-surrounding-whitespace.phpt
  12. +0 27 tests/mustache-spec-delimiter-indented-standalone-tag.phpt
  13. +0 43 tests/mustache-spec-delimiter-inverted-sections.phpt
  14. +0 24 tests/mustache-spec-delimiter-outlying-whitespace-inline.phpt
  15. +0 23 tests/mustache-spec-delimiter-pair-behavior.phpt
  16. +0 22 tests/mustache-spec-delimiter-pair-with-padding.phpt
  17. +0 32 tests/mustache-spec-delimiter-partial-inheritence.phpt
  18. +0 31 tests/mustache-spec-delimiter-post-partial-behavior.phpt
  19. +0 43 tests/mustache-spec-delimiter-sections.phpt
  20. +0 23 tests/mustache-spec-delimiter-special-characters.phpt
  21. +0 25 tests/mustache-spec-delimiter-standalone-line-endings.phpt
  22. +0 27 tests/mustache-spec-delimiter-standalone-tag.phpt
  23. +0 24 tests/mustache-spec-delimiter-standalone-without-newline.phpt
  24. +0 23 tests/mustache-spec-delimiter-standalone-without-previous-line.phpt
  25. +0 22 tests/mustache-spec-delimiter-surrounding-whitespace.phpt
  26. +0 22 tests/mustache-spec-interpolatio-ampersand-context-miss-interpolation.phpt
  27. +0 23 tests/mustache-spec-interpolatio-ampersand-decimal-interpolation.phpt
  28. +0 23 tests/mustache-spec-interpolatio-ampersand-integer-interpolation.phpt
  29. +0 25 tests/mustache-spec-interpolatio-ampersand-standalone.phpt
  30. +0 23 tests/mustache-spec-interpolatio-ampersand-surrounding-whitespace.phpt
  31. +0 23 tests/mustache-spec-interpolatio-ampersand-with-padding.phpt
  32. +0 25 tests/mustache-spec-interpolatio-ampersand.phpt
  33. +0 22 tests/mustache-spec-interpolatio-basic-context-miss-interpolation.phpt
  34. +0 23 tests/mustache-spec-interpolatio-basic-decimal-interpolation.phpt
  35. +0 23 tests/mustache-spec-interpolatio-basic-integer-interpolation.phpt
  36. +0 25 tests/mustache-spec-interpolatio-basic-interpolation.phpt
  37. +0 26 tests/mustache-spec-interpolatio-dotted-names-ampersand-interpolation.phpt
  38. +0 38 tests/mustache-spec-interpolatio-dotted-names-arbitrary-depth.phpt
  39. +0 26 tests/mustache-spec-interpolatio-dotted-names-basic-interpolation.phpt
  40. +0 32 tests/mustache-spec-interpolatio-dotted-names-broken-chain-resolution.phpt
  41. +0 25 tests/mustache-spec-interpolatio-dotted-names-broken-chains.phpt
  42. +0 31 tests/mustache-spec-interpolatio-dotted-names-context-precedence.phpt
  43. +0 51 tests/mustache-spec-interpolatio-dotted-names-initial-resolution.phpt
  44. +0 26 tests/mustache-spec-interpolatio-dotted-names-triple-mustache-interpolation.phpt
  45. +0 25 tests/mustache-spec-interpolatio-html-escaping.phpt
  46. +0 25 tests/mustache-spec-interpolatio-interpolation-standalone.phpt
  47. +0 23 tests/mustache-spec-interpolatio-interpolation-surrounding-whitespace.phpt
  48. +0 23 tests/mustache-spec-interpolatio-interpolation-with-padding.phpt
  49. +0 24 tests/mustache-spec-interpolatio-no-interpolation.phpt
  50. +0 22 tests/mustache-spec-interpolatio-triple-mustache-context-miss-interpolation.phpt
  51. +0 23 tests/mustache-spec-interpolatio-triple-mustache-decimal-interpolation.phpt
  52. +0 23 tests/mustache-spec-interpolatio-triple-mustache-integer-interpolation.phpt
  53. +0 25 tests/mustache-spec-interpolatio-triple-mustache-standalone.phpt
  54. +0 23 tests/mustache-spec-interpolatio-triple-mustache-surrounding-whitespace.phpt
  55. +0 23 tests/mustache-spec-interpolatio-triple-mustache-with-padding.phpt
  56. +0 25 tests/mustache-spec-interpolatio-triple-mustache.phpt
  57. +0 22 tests/mustache-spec-inverte-context-misses.phpt
  58. +0 26 tests/mustache-spec-inverte-context.phpt
  59. +0 25 tests/mustache-spec-inverte-dotted-names-broken-chains.phpt
  60. +0 29 tests/mustache-spec-inverte-dotted-names-falsey.phpt
  61. +0 29 tests/mustache-spec-inverte-dotted-names-truthy.phpt
  62. +0 34 tests/mustache-spec-inverte-doubled.phpt
  63. +0 25 tests/mustache-spec-inverte-empty-list.phpt
  64. +0 23 tests/mustache-spec-inverte-falsey.phpt
  65. +0 27 tests/mustache-spec-inverte-indented-inline-sections.phpt
  66. +0 27 tests/mustache-spec-inverte-internal-whitespace.phpt
  67. +0 37 tests/mustache-spec-inverte-list.phpt
  68. +0 23 tests/mustache-spec-inverte-nested-falsey.phpt
  69. +0 23 tests/mustache-spec-inverte-nested-truthy.phpt
  70. +0 23 tests/mustache-spec-inverte-padding.phpt
  71. +0 31 tests/mustache-spec-inverte-standalone-indented-lines.phpt
  72. +0 27 tests/mustache-spec-inverte-standalone-line-endings.phpt
  73. +0 31 tests/mustache-spec-inverte-standalone-lines.phpt
  74. +0 27 tests/mustache-spec-inverte-standalone-without-newline.phpt
  75. +0 26 tests/mustache-spec-inverte-standalone-without-previous-line.phpt
  76. +0 25 tests/mustache-spec-inverte-surrounding-whitespace.phpt
  77. +0 23 tests/mustache-spec-inverte-truthy.phpt
  78. +0 26 tests/mustache-spec-partial-basic-behavior.phpt
  79. +0 27 tests/mustache-spec-partial-context.phpt
  80. +0 25 tests/mustache-spec-partial-failed-lookup.phpt
  81. +0 31 tests/mustache-spec-partial-inline-indentation.phpt
  82. +0 27 tests/mustache-spec-partial-padding-whitespace.phpt
  83. +0 37 tests/mustache-spec-partial-recursion.phpt
  84. +0 40 tests/mustache-spec-partial-standalone-indentation.phpt
  85. +0 29 tests/mustache-spec-partial-standalone-line-endings.phpt
  86. +0 30 tests/mustache-spec-partial-standalone-without-newline.phpt
  87. +0 29 tests/mustache-spec-partial-standalone-without-previous-line.phpt
  88. +0 26 tests/mustache-spec-partial-surrounding-whitespace.phpt
  89. +0 22 tests/mustache-spec-section-context-misses.phpt
  90. +0 26 tests/mustache-spec-section-context.phpt
  91. +0 70 tests/mustache-spec-section-deeply-nested-contexts.phpt
  92. +0 25 tests/mustache-spec-section-dotted-names-broken-chains.phpt
  93. +0 29 tests/mustache-spec-section-dotted-names-falsey.phpt
  94. +0 29 tests/mustache-spec-section-dotted-names-truthy.phpt
  95. +0 34 tests/mustache-spec-section-doubled.phpt
  96. +0 25 tests/mustache-spec-section-empty-list.phpt
  97. +0 23 tests/mustache-spec-section-falsey.phpt
  98. +0 30 tests/mustache-spec-section-implicit-iterator-decimal.phpt
  99. +0 30 tests/mustache-spec-section-implicit-iterator-integer.phpt
  100. +0 30 tests/mustache-spec-section-implicit-iterator-string.phpt
  101. +0 27 tests/mustache-spec-section-indented-inline-sections.phpt
  102. +0 31 tests/mustache-spec-section-indented-standalone-lines.phpt
  103. +0 27 tests/mustache-spec-section-internal-whitespace.phpt
  104. +0 37 tests/mustache-spec-section-list.phpt
  105. +0 23 tests/mustache-spec-section-nested-falsey.phpt
  106. +0 23 tests/mustache-spec-section-nested-truthy.phpt
  107. +0 23 tests/mustache-spec-section-padding.phpt
  108. +0 27 tests/mustache-spec-section-standalone-line-endings.phpt
  109. +0 31 tests/mustache-spec-section-standalone-lines.phpt
  110. +0 27 tests/mustache-spec-section-standalone-without-newline.phpt
  111. +0 26 tests/mustache-spec-section-standalone-without-previous-line.phpt
  112. +0 25 tests/mustache-spec-section-surrounding-whitespace.phpt
  113. +0 23 tests/mustache-spec-section-truthy.phpt
24 tests/mustache-spec-comment-indented-inline.phpt
... ... @@ -1,24 +0,0 @@
1   ---TEST--
2   -Indented Inline
3   ---DESCRIPTION--
4   -Inline comments should not strip whitespace
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Indented Inline',
11   - 'desc' => 'Inline comments should not strip whitespace',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => ' 12 {{! 34 }}
16   -',
17   - 'expected' => ' 12
18   -',
19   -);
20   -$mustache = new Mustache();
21   -echo $mustache->render($test["template"], $test["data"]);
22   -?>
23   ---EXPECTREGEX--
24   -\s*12\s*
29 tests/mustache-spec-comment-indented-multiline-standalone.phpt
... ... @@ -1,29 +0,0 @@
1   ---TEST--
2   -Indented Multiline Standalone
3   ---DESCRIPTION--
4   -All standalone comment lines should be removed.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Indented Multiline Standalone',
11   - 'desc' => 'All standalone comment lines should be removed.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'Begin.
16   - {{!
17   - Something\'s going on here...
18   - }}
19   -End.
20   -',
21   - 'expected' => 'Begin.
22   -End.
23   -',
24   -);
25   -$mustache = new Mustache();
26   -echo $mustache->render($test["template"], $test["data"]);
27   -?>
28   ---EXPECTREGEX--
29   -Begin\.\s*End\.\s*
27 tests/mustache-spec-comment-indented-standalone.phpt
... ... @@ -1,27 +0,0 @@
1   ---TEST--
2   -Indented Standalone
3   ---DESCRIPTION--
4   -All standalone comment lines should be removed.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Indented Standalone',
11   - 'desc' => 'All standalone comment lines should be removed.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'Begin.
16   - {{! Indented Comment Block! }}
17   -End.
18   -',
19   - 'expected' => 'Begin.
20   -End.
21   -',
22   -);
23   -$mustache = new Mustache();
24   -echo $mustache->render($test["template"], $test["data"]);
25   -?>
26   ---EXPECTREGEX--
27   -Begin\.\s*End\.\s*
22 tests/mustache-spec-comment-inline.phpt
... ... @@ -1,22 +0,0 @@
1   ---TEST--
2   -Inline
3   ---DESCRIPTION--
4   -Comment blocks should be removed from the template.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Inline',
11   - 'desc' => 'Comment blocks should be removed from the template.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '12345{{! Comment Block! }}67890',
16   - 'expected' => '1234567890',
17   -);
18   -$mustache = new Mustache();
19   -echo $mustache->render($test["template"], $test["data"]);
20   -?>
21   ---EXPECTREGEX--
22   -1234567890
29 tests/mustache-spec-comment-multiline-standalone.phpt
... ... @@ -1,29 +0,0 @@
1   ---TEST--
2   -Multiline Standalone
3   ---DESCRIPTION--
4   -All standalone comment lines should be removed.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Multiline Standalone',
11   - 'desc' => 'All standalone comment lines should be removed.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'Begin.
16   -{{!
17   -Something\'s going on here...
18   -}}
19   -End.
20   -',
21   - 'expected' => 'Begin.
22   -End.
23   -',
24   -);
25   -$mustache = new Mustache();
26   -echo $mustache->render($test["template"], $test["data"]);
27   -?>
28   ---EXPECTREGEX--
29   -Begin\.\s*End\.\s*
27 tests/mustache-spec-comment-multiline.phpt
... ... @@ -1,27 +0,0 @@
1   ---TEST--
2   -Multiline
3   ---DESCRIPTION--
4   -Multiline comments should be permitted.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Multiline',
11   - 'desc' => 'Multiline comments should be permitted.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '12345{{!
16   - This is a
17   - multi-line comment...
18   -}}67890
19   -',
20   - 'expected' => '1234567890
21   -',
22   -);
23   -$mustache = new Mustache();
24   -echo $mustache->render($test["template"], $test["data"]);
25   -?>
26   ---EXPECTREGEX--
27   -1234567890\s*
25 tests/mustache-spec-comment-standalone-line-endings.phpt
... ... @@ -1,25 +0,0 @@
1   ---TEST--
2   -Standalone Line Endings
3   ---DESCRIPTION--
4   -"\r\n" should be considered a newline for standalone tags.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Line Endings',
11   - 'desc' => '"\\r\\n" should be considered a newline for standalone tags.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '|
16   -{{! Standalone Comment }}
17   -|',
18   - 'expected' => '|
19   -|',
20   -);
21   -$mustache = new Mustache();
22   -echo $mustache->render($test["template"], $test["data"]);
23   -?>
24   ---EXPECTREGEX--
25   -\|\s*\|
24 tests/mustache-spec-comment-standalone-without-newline.phpt
... ... @@ -1,24 +0,0 @@
1   ---TEST--
2   -Standalone Without Newline
3   ---DESCRIPTION--
4   -Standalone tags should not require a newline to follow them.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Without Newline',
11   - 'desc' => 'Standalone tags should not require a newline to follow them.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '!
16   - {{! I\'m Still Standalone }}',
17   - 'expected' => '!
18   -',
19   -);
20   -$mustache = new Mustache();
21   -echo $mustache->render($test["template"], $test["data"]);
22   -?>
23   ---EXPECTREGEX--
24   -\!\s*
23 tests/mustache-spec-comment-standalone-without-previous-line.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Standalone Without Previous Line
3   ---DESCRIPTION--
4   -Standalone tags should not require a newline to precede them.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Without Previous Line',
11   - 'desc' => 'Standalone tags should not require a newline to precede them.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => ' {{! I\'m Still Standalone }}
16   -!',
17   - 'expected' => '!',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -\!
27 tests/mustache-spec-comment-standalone.phpt
... ... @@ -1,27 +0,0 @@
1   ---TEST--
2   -Standalone
3   ---DESCRIPTION--
4   -All standalone comment lines should be removed.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone',
11   - 'desc' => 'All standalone comment lines should be removed.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'Begin.
16   -{{! Comment Block! }}
17   -End.
18   -',
19   - 'expected' => 'Begin.
20   -End.
21   -',
22   -);
23   -$mustache = new Mustache();
24   -echo $mustache->render($test["template"], $test["data"]);
25   -?>
26   ---EXPECTREGEX--
27   -Begin\.\s*End\.\s*
22 tests/mustache-spec-comment-surrounding-whitespace.phpt
... ... @@ -1,22 +0,0 @@
1   ---TEST--
2   -Surrounding Whitespace
3   ---DESCRIPTION--
4   -Comment removal should preserve surrounding whitespace.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Surrounding Whitespace',
11   - 'desc' => 'Comment removal should preserve surrounding whitespace.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '12345 {{! Comment Block! }} 67890',
16   - 'expected' => '12345 67890',
17   -);
18   -$mustache = new Mustache();
19   -echo $mustache->render($test["template"], $test["data"]);
20   -?>
21   ---EXPECTREGEX--
22   -12345\s*67890
27 tests/mustache-spec-delimiter-indented-standalone-tag.phpt
... ... @@ -1,27 +0,0 @@
1   ---TEST--
2   -Indented Standalone Tag
3   ---DESCRIPTION--
4   -Indented standalone lines should be removed from the template.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Indented Standalone Tag',
11   - 'desc' => 'Indented standalone lines should be removed from the template.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'Begin.
16   - {{=@ @=}}
17   -End.
18   -',
19   - 'expected' => 'Begin.
20   -End.
21   -',
22   -);
23   -$mustache = new Mustache();
24   -echo $mustache->render($test["template"], $test["data"]);
25   -?>
26   ---EXPECTREGEX--
27   -Begin\.\s*End\.\s*
43 tests/mustache-spec-delimiter-inverted-sections.phpt
... ... @@ -1,43 +0,0 @@
1   ---TEST--
2   -Inverted Sections
3   ---DESCRIPTION--
4   -Delimiters set outside inverted sections should persist.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Inverted Sections',
11   - 'desc' => 'Delimiters set outside inverted sections should persist.',
12   - 'data' =>
13   - array (
14   - 'section' => false,
15   - 'data' => 'I got interpolated.',
16   - ),
17   - 'template' => '[
18   -{{^section}}
19   - {{data}}
20   - |data|
21   -{{/section}}
22   -
23   -{{= | | =}}
24   -|^section|
25   - {{data}}
26   - |data|
27   -|/section|
28   -]
29   -',
30   - 'expected' => '[
31   - I got interpolated.
32   - |data|
33   -
34   - {{data}}
35   - I got interpolated.
36   -]
37   -',
38   -);
39   -$mustache = new Mustache();
40   -echo $mustache->render($test["template"], $test["data"]);
41   -?>
42   ---EXPECTREGEX--
43   -\[\s*I\s*got\s*interpolated\.\s*\|data\|\s*\{\{data\}\}\s*I\s*got\s*interpolated\.\s*\]\s*
24 tests/mustache-spec-delimiter-outlying-whitespace-inline.phpt
... ... @@ -1,24 +0,0 @@
1   ---TEST--
2   -Outlying Whitespace (Inline)
3   ---DESCRIPTION--
4   -Whitespace should be left untouched.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Outlying Whitespace (Inline)',
11   - 'desc' => 'Whitespace should be left untouched.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => ' | {{=@ @=}}
16   -',
17   - 'expected' => ' |
18   -',
19   -);
20   -$mustache = new Mustache();
21   -echo $mustache->render($test["template"], $test["data"]);
22   -?>
23   ---EXPECTREGEX--
24   -\s*\|\s*
23 tests/mustache-spec-delimiter-pair-behavior.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Pair Behavior
3   ---DESCRIPTION--
4   -The equals sign (used on both sides) should permit delimiter changes.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Pair Behavior',
11   - 'desc' => 'The equals sign (used on both sides) should permit delimiter changes.',
12   - 'data' =>
13   - array (
14   - 'text' => 'Hey!',
15   - ),
16   - 'template' => '{{=<% %>=}}(<%text%>)',
17   - 'expected' => '(Hey!)',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -\(Hey\!\)
22 tests/mustache-spec-delimiter-pair-with-padding.phpt
... ... @@ -1,22 +0,0 @@
1   ---TEST--
2   -Pair with Padding
3   ---DESCRIPTION--
4   -Superfluous in-tag whitespace should be ignored.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Pair with Padding',
11   - 'desc' => 'Superfluous in-tag whitespace should be ignored.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '|{{= @ @ =}}|',
16   - 'expected' => '||',
17   -);
18   -$mustache = new Mustache();
19   -echo $mustache->render($test["template"], $test["data"]);
20   -?>
21   ---EXPECTREGEX--
22   -\|\|
32 tests/mustache-spec-delimiter-partial-inheritence.phpt
... ... @@ -1,32 +0,0 @@
1   ---TEST--
2   -Partial Inheritence
3   ---DESCRIPTION--
4   -Delimiters set in a parent template should not affect a partial.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Partial Inheritence',
11   - 'desc' => 'Delimiters set in a parent template should not affect a partial.',
12   - 'data' =>
13   - array (
14   - 'value' => 'yes',
15   - ),
16   - 'partials' =>
17   - array (
18   - 'include' => '.{{value}}.',
19   - ),
20   - 'template' => '[ {{>include}} ]
21   -{{= | | =}}
22   -[ |>include| ]
23   -',
24   - 'expected' => '[ .yes. ]
25   -[ .yes. ]
26   -',
27   -);
28   -$mustache = new Mustache();
29   -echo $mustache->render($test["template"], $test["data"], $test["partials"]);
30   -?>
31   ---EXPECTREGEX--
32   -\[\s*\.yes\.\s*\]\s*\[\s*\.yes\.\s*\]\s*
31 tests/mustache-spec-delimiter-post-partial-behavior.phpt
... ... @@ -1,31 +0,0 @@
1   ---TEST--
2   -Post-Partial Behavior
3   ---DESCRIPTION--
4   -Delimiters set in a partial should not affect the parent template.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Post-Partial Behavior',
11   - 'desc' => 'Delimiters set in a partial should not affect the parent template.',
12   - 'data' =>
13   - array (
14   - 'value' => 'yes',
15   - ),
16   - 'partials' =>
17   - array (
18   - 'include' => '.{{value}}. {{= | | =}} .|value|.',
19   - ),
20   - 'template' => '[ {{>include}} ]
21   -[ .{{value}}. .|value|. ]
22   -',
23   - 'expected' => '[ .yes. .yes. ]
24   -[ .yes. .|value|. ]
25   -',
26   -);
27   -$mustache = new Mustache();
28   -echo $mustache->render($test["template"], $test["data"], $test["partials"]);
29   -?>
30   ---EXPECTREGEX--
31   -\[\s*\.yes\.\s*\.yes\.\s*\]\s*\[\s*\.yes\.\s*\.\|value\|\.\s*\]\s*
43 tests/mustache-spec-delimiter-sections.phpt
... ... @@ -1,43 +0,0 @@
1   ---TEST--
2   -Sections
3   ---DESCRIPTION--
4   -Delimiters set outside sections should persist.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Sections',
11   - 'desc' => 'Delimiters set outside sections should persist.',
12   - 'data' =>
13   - array (
14   - 'section' => true,
15   - 'data' => 'I got interpolated.',
16   - ),
17   - 'template' => '[
18   -{{#section}}
19   - {{data}}
20   - |data|
21   -{{/section}}
22   -
23   -{{= | | =}}
24   -|#section|
25   - {{data}}
26   - |data|
27   -|/section|
28   -]
29   -',
30   - 'expected' => '[
31   - I got interpolated.
32   - |data|
33   -
34   - {{data}}
35   - I got interpolated.
36   -]
37   -',
38   -);
39   -$mustache = new Mustache();
40   -echo $mustache->render($test["template"], $test["data"]);
41   -?>
42   ---EXPECTREGEX--
43   -\[\s*I\s*got\s*interpolated\.\s*\|data\|\s*\{\{data\}\}\s*I\s*got\s*interpolated\.\s*\]\s*
23 tests/mustache-spec-delimiter-special-characters.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Special Characters
3   ---DESCRIPTION--
4   -Characters with special meaning regexen should be valid delimiters.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Special Characters',
11   - 'desc' => 'Characters with special meaning regexen should be valid delimiters.',
12   - 'data' =>
13   - array (
14   - 'text' => 'It worked!',
15   - ),
16   - 'template' => '({{=[ ]=}}[text])',
17   - 'expected' => '(It worked!)',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -\(It\s*worked\!\)
25 tests/mustache-spec-delimiter-standalone-line-endings.phpt
... ... @@ -1,25 +0,0 @@
1   ---TEST--
2   -Standalone Line Endings
3   ---DESCRIPTION--
4   -"\r\n" should be considered a newline for standalone tags.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Line Endings',
11   - 'desc' => '"\\r\\n" should be considered a newline for standalone tags.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '|
16   -{{= @ @ =}}
17   -|',
18   - 'expected' => '|
19   -|',
20   -);
21   -$mustache = new Mustache();
22   -echo $mustache->render($test["template"], $test["data"]);
23   -?>
24   ---EXPECTREGEX--
25   -\|\s*\|
27 tests/mustache-spec-delimiter-standalone-tag.phpt
... ... @@ -1,27 +0,0 @@
1   ---TEST--
2   -Standalone Tag
3   ---DESCRIPTION--
4   -Standalone lines should be removed from the template.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Tag',
11   - 'desc' => 'Standalone lines should be removed from the template.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'Begin.
16   -{{=@ @=}}
17   -End.
18   -',
19   - 'expected' => 'Begin.
20   -End.
21   -',
22   -);
23   -$mustache = new Mustache();
24   -echo $mustache->render($test["template"], $test["data"]);
25   -?>
26   ---EXPECTREGEX--
27   -Begin\.\s*End\.\s*
24 tests/mustache-spec-delimiter-standalone-without-newline.phpt
... ... @@ -1,24 +0,0 @@
1   ---TEST--
2   -Standalone Without Newline
3   ---DESCRIPTION--
4   -Standalone tags should not require a newline to follow them.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Without Newline',
11   - 'desc' => 'Standalone tags should not require a newline to follow them.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '=
16   - {{=@ @=}}',
17   - 'expected' => '=
18   -',
19   -);
20   -$mustache = new Mustache();
21   -echo $mustache->render($test["template"], $test["data"]);
22   -?>
23   ---EXPECTREGEX--
24   -\=\s*
23 tests/mustache-spec-delimiter-standalone-without-previous-line.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Standalone Without Previous Line
3   ---DESCRIPTION--
4   -Standalone tags should not require a newline to precede them.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Standalone Without Previous Line',
11   - 'desc' => 'Standalone tags should not require a newline to precede them.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => ' {{=@ @=}}
16   -=',
17   - 'expected' => '=',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -\=
22 tests/mustache-spec-delimiter-surrounding-whitespace.phpt
... ... @@ -1,22 +0,0 @@
1   ---TEST--
2   -Surrounding Whitespace
3   ---DESCRIPTION--
4   -Surrounding whitespace should be left untouched.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Surrounding Whitespace',
11   - 'desc' => 'Surrounding whitespace should be left untouched.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => '| {{=@ @=}} |',
16   - 'expected' => '| |',
17   -);
18   -$mustache = new Mustache();
19   -echo $mustache->render($test["template"], $test["data"]);
20   -?>
21   ---EXPECTREGEX--
22   -\|\s*\|
22 tests/mustache-spec-interpolatio-ampersand-context-miss-interpolation.phpt
... ... @@ -1,22 +0,0 @@
1   ---TEST--
2   -Ampersand Context Miss Interpolation
3   ---DESCRIPTION--
4   -Failed context lookups should default to empty strings.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand Context Miss Interpolation',
11   - 'desc' => 'Failed context lookups should default to empty strings.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'I ({{&cannot}}) be seen!',
16   - 'expected' => 'I () be seen!',
17   -);
18   -$mustache = new Mustache();
19   -echo $mustache->render($test["template"], $test["data"]);
20   -?>
21   ---EXPECTREGEX--
22   -I\s*\(\)\s*be\s*seen\!
23 tests/mustache-spec-interpolatio-ampersand-decimal-interpolation.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Ampersand Decimal Interpolation
3   ---DESCRIPTION--
4   -Decimals should interpolate seamlessly with proper significance.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand Decimal Interpolation',
11   - 'desc' => 'Decimals should interpolate seamlessly with proper significance.',
12   - 'data' =>
13   - array (
14   - 'power' => 1.21,
15   - ),
16   - 'template' => '"{{&power}} jiggawatts!"',
17   - 'expected' => '"1.21 jiggawatts!"',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -"1\.21\s*jiggawatts\!"
23 tests/mustache-spec-interpolatio-ampersand-integer-interpolation.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Ampersand Integer Interpolation
3   ---DESCRIPTION--
4   -Integers should interpolate seamlessly.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand Integer Interpolation',
11   - 'desc' => 'Integers should interpolate seamlessly.',
12   - 'data' =>
13   - array (
14   - 'mph' => 85,
15   - ),
16   - 'template' => '"{{&mph}} miles an hour!"',
17   - 'expected' => '"85 miles an hour!"',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -"85\s*miles\s*an\s*hour\!"
25 tests/mustache-spec-interpolatio-ampersand-standalone.phpt
... ... @@ -1,25 +0,0 @@
1   ---TEST--
2   -Ampersand - Standalone
3   ---DESCRIPTION--
4   -Standalone interpolation should not alter surrounding whitespace.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand - Standalone',
11   - 'desc' => 'Standalone interpolation should not alter surrounding whitespace.',
12   - 'data' =>
13   - array (
14   - 'string' => '---',
15   - ),
16   - 'template' => ' {{&string}}
17   -',
18   - 'expected' => ' ---
19   -',
20   -);
21   -$mustache = new Mustache();
22   -echo $mustache->render($test["template"], $test["data"]);
23   -?>
24   ---EXPECTREGEX--
25   -\s*\-\-\-\s*
23 tests/mustache-spec-interpolatio-ampersand-surrounding-whitespace.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Ampersand - Surrounding Whitespace
3   ---DESCRIPTION--
4   -Interpolation should not alter surrounding whitespace.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand - Surrounding Whitespace',
11   - 'desc' => 'Interpolation should not alter surrounding whitespace.',
12   - 'data' =>
13   - array (
14   - 'string' => '---',
15   - ),
16   - 'template' => '| {{&string}} |',
17   - 'expected' => '| --- |',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -\|\s*\-\-\-\s*\|
23 tests/mustache-spec-interpolatio-ampersand-with-padding.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Ampersand With Padding
3   ---DESCRIPTION--
4   -Superfluous in-tag whitespace should be ignored.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand With Padding',
11   - 'desc' => 'Superfluous in-tag whitespace should be ignored.',
12   - 'data' =>
13   - array (
14   - 'string' => '---',
15   - ),
16   - 'template' => '|{{& string }}|',
17   - 'expected' => '|---|',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -\|\-\-\-\|
25 tests/mustache-spec-interpolatio-ampersand.phpt
... ... @@ -1,25 +0,0 @@
1   ---TEST--
2   -Ampersand
3   ---DESCRIPTION--
4   -Ampersand should interpolate without HTML escaping.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Ampersand',
11   - 'desc' => 'Ampersand should interpolate without HTML escaping.',
12   - 'data' =>
13   - array (
14   - 'forbidden' => '& " < >',
15   - ),
16   - 'template' => 'These characters should not be HTML escaped: {{&forbidden}}
17   -',
18   - 'expected' => 'These characters should not be HTML escaped: & " < >
19   -',
20   -);
21   -$mustache = new Mustache();
22   -echo $mustache->render($test["template"], $test["data"]);
23   -?>
24   ---EXPECTREGEX--
25   -These\s*characters\s*should\s*not\s*be\s*HTML\s*escaped\:\s*&\s*"\s*\<\s*\>\s*
22 tests/mustache-spec-interpolatio-basic-context-miss-interpolation.phpt
... ... @@ -1,22 +0,0 @@
1   ---TEST--
2   -Basic Context Miss Interpolation
3   ---DESCRIPTION--
4   -Failed context lookups should default to empty strings.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Basic Context Miss Interpolation',
11   - 'desc' => 'Failed context lookups should default to empty strings.',
12   - 'data' =>
13   - array (
14   - ),
15   - 'template' => 'I ({{cannot}}) be seen!',
16   - 'expected' => 'I () be seen!',
17   -);
18   -$mustache = new Mustache();
19   -echo $mustache->render($test["template"], $test["data"]);
20   -?>
21   ---EXPECTREGEX--
22   -I\s*\(\)\s*be\s*seen\!
23 tests/mustache-spec-interpolatio-basic-decimal-interpolation.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Basic Decimal Interpolation
3   ---DESCRIPTION--
4   -Decimals should interpolate seamlessly with proper significance.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Basic Decimal Interpolation',
11   - 'desc' => 'Decimals should interpolate seamlessly with proper significance.',
12   - 'data' =>
13   - array (
14   - 'power' => 1.21,
15   - ),
16   - 'template' => '"{{power}} jiggawatts!"',
17   - 'expected' => '"1.21 jiggawatts!"',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -"1\.21\s*jiggawatts\!"
23 tests/mustache-spec-interpolatio-basic-integer-interpolation.phpt
... ... @@ -1,23 +0,0 @@
1   ---TEST--
2   -Basic Integer Interpolation
3   ---DESCRIPTION--
4   -Integers should interpolate seamlessly.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Basic Integer Interpolation',
11   - 'desc' => 'Integers should interpolate seamlessly.',
12   - 'data' =>
13   - array (
14   - 'mph' => 85,
15   - ),
16   - 'template' => '"{{mph}} miles an hour!"',
17   - 'expected' => '"85 miles an hour!"',
18   -);
19   -$mustache = new Mustache();
20   -echo $mustache->render($test["template"], $test["data"]);
21   -?>
22   ---EXPECTREGEX--
23   -"85\s*miles\s*an\s*hour\!"
25 tests/mustache-spec-interpolatio-basic-interpolation.phpt
... ... @@ -1,25 +0,0 @@
1   ---TEST--
2   -Basic Interpolation
3   ---DESCRIPTION--
4   -Unadorned tags should interpolate content into the template.
5   ---SKIPIF--
6   -<?php if(!extension_loaded('mustache')) die('skip '); ?>
7   ---FILE--
8   -<?php
9   -$test = array (
10   - 'name' => 'Basic Interpolation',
11   - 'desc' => 'Unadorned tags should interpolate content into the template.',
12   - 'data' =>
13   - array (
14   - 'subject' => 'world',
15   - ),
16   - 'template' => 'Hello, {{subject}}!
17   -',
18   - 'expected' => 'Hello, world!
19   -',
20   -);
21   -$mustache = new Mustache();
22   -echo $mustache->render($test["template"], $test["data"]);
23   -?>
24   ---EXPECTREGEX--
25   -Hello,\s*world\!\s*
26 tests/mustache-spec-interpolatio-dotted-names-ampersand-interpolation.phpt
... ... @@ -1,26 +0,0 @@
1   ---TEST--