Permalink
Browse files

Fixing broken tests -_-;

  • Loading branch information...
1 parent 13c5e7b commit 6cba87360fc53d0cc94ca2206c1fc652dcf489d3 @jbboehr committed Jul 11, 2012
Showing with 0 additions and 3,077 deletions.
  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
View
24 tests/mustache-spec-comment-indented-inline.phpt
@@ -1,24 +0,0 @@
---TEST--
-Indented Inline
---DESCRIPTION--
-Inline comments should not strip whitespace
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Indented Inline',
- 'desc' => 'Inline comments should not strip whitespace',
- 'data' =>
- array (
- ),
- 'template' => ' 12 {{! 34 }}
-',
- 'expected' => ' 12
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*12\s*
View
29 tests/mustache-spec-comment-indented-multiline-standalone.phpt
@@ -1,29 +0,0 @@
---TEST--
-Indented Multiline Standalone
---DESCRIPTION--
-All standalone comment lines should be removed.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Indented Multiline Standalone',
- 'desc' => 'All standalone comment lines should be removed.',
- 'data' =>
- array (
- ),
- 'template' => 'Begin.
- {{!
- Something\'s going on here...
- }}
-End.
-',
- 'expected' => 'Begin.
-End.
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Begin\.\s*End\.\s*
View
27 tests/mustache-spec-comment-indented-standalone.phpt
@@ -1,27 +0,0 @@
---TEST--
-Indented Standalone
---DESCRIPTION--
-All standalone comment lines should be removed.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Indented Standalone',
- 'desc' => 'All standalone comment lines should be removed.',
- 'data' =>
- array (
- ),
- 'template' => 'Begin.
- {{! Indented Comment Block! }}
-End.
-',
- 'expected' => 'Begin.
-End.
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Begin\.\s*End\.\s*
View
22 tests/mustache-spec-comment-inline.phpt
@@ -1,22 +0,0 @@
---TEST--
-Inline
---DESCRIPTION--
-Comment blocks should be removed from the template.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Inline',
- 'desc' => 'Comment blocks should be removed from the template.',
- 'data' =>
- array (
- ),
- 'template' => '12345{{! Comment Block! }}67890',
- 'expected' => '1234567890',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-1234567890
View
29 tests/mustache-spec-comment-multiline-standalone.phpt
@@ -1,29 +0,0 @@
---TEST--
-Multiline Standalone
---DESCRIPTION--
-All standalone comment lines should be removed.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Multiline Standalone',
- 'desc' => 'All standalone comment lines should be removed.',
- 'data' =>
- array (
- ),
- 'template' => 'Begin.
-{{!
-Something\'s going on here...
-}}
-End.
-',
- 'expected' => 'Begin.
-End.
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Begin\.\s*End\.\s*
View
27 tests/mustache-spec-comment-multiline.phpt
@@ -1,27 +0,0 @@
---TEST--
-Multiline
---DESCRIPTION--
-Multiline comments should be permitted.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Multiline',
- 'desc' => 'Multiline comments should be permitted.',
- 'data' =>
- array (
- ),
- 'template' => '12345{{!
- This is a
- multi-line comment...
-}}67890
-',
- 'expected' => '1234567890
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-1234567890\s*
View
25 tests/mustache-spec-comment-standalone-line-endings.phpt
@@ -1,25 +0,0 @@
---TEST--
-Standalone Line Endings
---DESCRIPTION--
-"\r\n" should be considered a newline for standalone tags.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Line Endings',
- 'desc' => '"\\r\\n" should be considered a newline for standalone tags.',
- 'data' =>
- array (
- ),
- 'template' => '|
-{{! Standalone Comment }}
-|',
- 'expected' => '|
-|',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\s*\|
View
24 tests/mustache-spec-comment-standalone-without-newline.phpt
@@ -1,24 +0,0 @@
---TEST--
-Standalone Without Newline
---DESCRIPTION--
-Standalone tags should not require a newline to follow them.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Without Newline',
- 'desc' => 'Standalone tags should not require a newline to follow them.',
- 'data' =>
- array (
- ),
- 'template' => '!
- {{! I\'m Still Standalone }}',
- 'expected' => '!
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\!\s*
View
23 tests/mustache-spec-comment-standalone-without-previous-line.phpt
@@ -1,23 +0,0 @@
---TEST--
-Standalone Without Previous Line
---DESCRIPTION--
-Standalone tags should not require a newline to precede them.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Without Previous Line',
- 'desc' => 'Standalone tags should not require a newline to precede them.',
- 'data' =>
- array (
- ),
- 'template' => ' {{! I\'m Still Standalone }}
-!',
- 'expected' => '!',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\!
View
27 tests/mustache-spec-comment-standalone.phpt
@@ -1,27 +0,0 @@
---TEST--
-Standalone
---DESCRIPTION--
-All standalone comment lines should be removed.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone',
- 'desc' => 'All standalone comment lines should be removed.',
- 'data' =>
- array (
- ),
- 'template' => 'Begin.
-{{! Comment Block! }}
-End.
-',
- 'expected' => 'Begin.
-End.
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Begin\.\s*End\.\s*
View
22 tests/mustache-spec-comment-surrounding-whitespace.phpt
@@ -1,22 +0,0 @@
---TEST--
-Surrounding Whitespace
---DESCRIPTION--
-Comment removal should preserve surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Surrounding Whitespace',
- 'desc' => 'Comment removal should preserve surrounding whitespace.',
- 'data' =>
- array (
- ),
- 'template' => '12345 {{! Comment Block! }} 67890',
- 'expected' => '12345 67890',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-12345\s*67890
View
27 tests/mustache-spec-delimiter-indented-standalone-tag.phpt
@@ -1,27 +0,0 @@
---TEST--
-Indented Standalone Tag
---DESCRIPTION--
-Indented standalone lines should be removed from the template.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Indented Standalone Tag',
- 'desc' => 'Indented standalone lines should be removed from the template.',
- 'data' =>
- array (
- ),
- 'template' => 'Begin.
- {{=@ @=}}
-End.
-',
- 'expected' => 'Begin.
-End.
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Begin\.\s*End\.\s*
View
43 tests/mustache-spec-delimiter-inverted-sections.phpt
@@ -1,43 +0,0 @@
---TEST--
-Inverted Sections
---DESCRIPTION--
-Delimiters set outside inverted sections should persist.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Inverted Sections',
- 'desc' => 'Delimiters set outside inverted sections should persist.',
- 'data' =>
- array (
- 'section' => false,
- 'data' => 'I got interpolated.',
- ),
- 'template' => '[
-{{^section}}
- {{data}}
- |data|
-{{/section}}
-
-{{= | | =}}
-|^section|
- {{data}}
- |data|
-|/section|
-]
-',
- 'expected' => '[
- I got interpolated.
- |data|
-
- {{data}}
- I got interpolated.
-]
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\[\s*I\s*got\s*interpolated\.\s*\|data\|\s*\{\{data\}\}\s*I\s*got\s*interpolated\.\s*\]\s*
View
24 tests/mustache-spec-delimiter-outlying-whitespace-inline.phpt
@@ -1,24 +0,0 @@
---TEST--
-Outlying Whitespace (Inline)
---DESCRIPTION--
-Whitespace should be left untouched.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Outlying Whitespace (Inline)',
- 'desc' => 'Whitespace should be left untouched.',
- 'data' =>
- array (
- ),
- 'template' => ' | {{=@ @=}}
-',
- 'expected' => ' |
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*\|\s*
View
23 tests/mustache-spec-delimiter-pair-behavior.phpt
@@ -1,23 +0,0 @@
---TEST--
-Pair Behavior
---DESCRIPTION--
-The equals sign (used on both sides) should permit delimiter changes.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Pair Behavior',
- 'desc' => 'The equals sign (used on both sides) should permit delimiter changes.',
- 'data' =>
- array (
- 'text' => 'Hey!',
- ),
- 'template' => '{{=<% %>=}}(<%text%>)',
- 'expected' => '(Hey!)',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\(Hey\!\)
View
22 tests/mustache-spec-delimiter-pair-with-padding.phpt
@@ -1,22 +0,0 @@
---TEST--
-Pair with Padding
---DESCRIPTION--
-Superfluous in-tag whitespace should be ignored.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Pair with Padding',
- 'desc' => 'Superfluous in-tag whitespace should be ignored.',
- 'data' =>
- array (
- ),
- 'template' => '|{{= @ @ =}}|',
- 'expected' => '||',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\|
View
32 tests/mustache-spec-delimiter-partial-inheritence.phpt
@@ -1,32 +0,0 @@
---TEST--
-Partial Inheritence
---DESCRIPTION--
-Delimiters set in a parent template should not affect a partial.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Partial Inheritence',
- 'desc' => 'Delimiters set in a parent template should not affect a partial.',
- 'data' =>
- array (
- 'value' => 'yes',
- ),
- 'partials' =>
- array (
- 'include' => '.{{value}}.',
- ),
- 'template' => '[ {{>include}} ]
-{{= | | =}}
-[ |>include| ]
-',
- 'expected' => '[ .yes. ]
-[ .yes. ]
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"], $test["partials"]);
-?>
---EXPECTREGEX--
-\[\s*\.yes\.\s*\]\s*\[\s*\.yes\.\s*\]\s*
View
31 tests/mustache-spec-delimiter-post-partial-behavior.phpt
@@ -1,31 +0,0 @@
---TEST--
-Post-Partial Behavior
---DESCRIPTION--
-Delimiters set in a partial should not affect the parent template.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Post-Partial Behavior',
- 'desc' => 'Delimiters set in a partial should not affect the parent template.',
- 'data' =>
- array (
- 'value' => 'yes',
- ),
- 'partials' =>
- array (
- 'include' => '.{{value}}. {{= | | =}} .|value|.',
- ),
- 'template' => '[ {{>include}} ]
-[ .{{value}}. .|value|. ]
-',
- 'expected' => '[ .yes. .yes. ]
-[ .yes. .|value|. ]
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"], $test["partials"]);
-?>
---EXPECTREGEX--
-\[\s*\.yes\.\s*\.yes\.\s*\]\s*\[\s*\.yes\.\s*\.\|value\|\.\s*\]\s*
View
43 tests/mustache-spec-delimiter-sections.phpt
@@ -1,43 +0,0 @@
---TEST--
-Sections
---DESCRIPTION--
-Delimiters set outside sections should persist.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Sections',
- 'desc' => 'Delimiters set outside sections should persist.',
- 'data' =>
- array (
- 'section' => true,
- 'data' => 'I got interpolated.',
- ),
- 'template' => '[
-{{#section}}
- {{data}}
- |data|
-{{/section}}
-
-{{= | | =}}
-|#section|
- {{data}}
- |data|
-|/section|
-]
-',
- 'expected' => '[
- I got interpolated.
- |data|
-
- {{data}}
- I got interpolated.
-]
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\[\s*I\s*got\s*interpolated\.\s*\|data\|\s*\{\{data\}\}\s*I\s*got\s*interpolated\.\s*\]\s*
View
23 tests/mustache-spec-delimiter-special-characters.phpt
@@ -1,23 +0,0 @@
---TEST--
-Special Characters
---DESCRIPTION--
-Characters with special meaning regexen should be valid delimiters.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Special Characters',
- 'desc' => 'Characters with special meaning regexen should be valid delimiters.',
- 'data' =>
- array (
- 'text' => 'It worked!',
- ),
- 'template' => '({{=[ ]=}}[text])',
- 'expected' => '(It worked!)',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\(It\s*worked\!\)
View
25 tests/mustache-spec-delimiter-standalone-line-endings.phpt
@@ -1,25 +0,0 @@
---TEST--
-Standalone Line Endings
---DESCRIPTION--
-"\r\n" should be considered a newline for standalone tags.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Line Endings',
- 'desc' => '"\\r\\n" should be considered a newline for standalone tags.',
- 'data' =>
- array (
- ),
- 'template' => '|
-{{= @ @ =}}
-|',
- 'expected' => '|
-|',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\s*\|
View
27 tests/mustache-spec-delimiter-standalone-tag.phpt
@@ -1,27 +0,0 @@
---TEST--
-Standalone Tag
---DESCRIPTION--
-Standalone lines should be removed from the template.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Tag',
- 'desc' => 'Standalone lines should be removed from the template.',
- 'data' =>
- array (
- ),
- 'template' => 'Begin.
-{{=@ @=}}
-End.
-',
- 'expected' => 'Begin.
-End.
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Begin\.\s*End\.\s*
View
24 tests/mustache-spec-delimiter-standalone-without-newline.phpt
@@ -1,24 +0,0 @@
---TEST--
-Standalone Without Newline
---DESCRIPTION--
-Standalone tags should not require a newline to follow them.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Without Newline',
- 'desc' => 'Standalone tags should not require a newline to follow them.',
- 'data' =>
- array (
- ),
- 'template' => '=
- {{=@ @=}}',
- 'expected' => '=
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\=\s*
View
23 tests/mustache-spec-delimiter-standalone-without-previous-line.phpt
@@ -1,23 +0,0 @@
---TEST--
-Standalone Without Previous Line
---DESCRIPTION--
-Standalone tags should not require a newline to precede them.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Standalone Without Previous Line',
- 'desc' => 'Standalone tags should not require a newline to precede them.',
- 'data' =>
- array (
- ),
- 'template' => ' {{=@ @=}}
-=',
- 'expected' => '=',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\=
View
22 tests/mustache-spec-delimiter-surrounding-whitespace.phpt
@@ -1,22 +0,0 @@
---TEST--
-Surrounding Whitespace
---DESCRIPTION--
-Surrounding whitespace should be left untouched.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Surrounding Whitespace',
- 'desc' => 'Surrounding whitespace should be left untouched.',
- 'data' =>
- array (
- ),
- 'template' => '| {{=@ @=}} |',
- 'expected' => '| |',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\s*\|
View
22 tests/mustache-spec-interpolatio-ampersand-context-miss-interpolation.phpt
@@ -1,22 +0,0 @@
---TEST--
-Ampersand Context Miss Interpolation
---DESCRIPTION--
-Failed context lookups should default to empty strings.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand Context Miss Interpolation',
- 'desc' => 'Failed context lookups should default to empty strings.',
- 'data' =>
- array (
- ),
- 'template' => 'I ({{&cannot}}) be seen!',
- 'expected' => 'I () be seen!',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-I\s*\(\)\s*be\s*seen\!
View
23 tests/mustache-spec-interpolatio-ampersand-decimal-interpolation.phpt
@@ -1,23 +0,0 @@
---TEST--
-Ampersand Decimal Interpolation
---DESCRIPTION--
-Decimals should interpolate seamlessly with proper significance.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand Decimal Interpolation',
- 'desc' => 'Decimals should interpolate seamlessly with proper significance.',
- 'data' =>
- array (
- 'power' => 1.21,
- ),
- 'template' => '"{{&power}} jiggawatts!"',
- 'expected' => '"1.21 jiggawatts!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"1\.21\s*jiggawatts\!"
View
23 tests/mustache-spec-interpolatio-ampersand-integer-interpolation.phpt
@@ -1,23 +0,0 @@
---TEST--
-Ampersand Integer Interpolation
---DESCRIPTION--
-Integers should interpolate seamlessly.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand Integer Interpolation',
- 'desc' => 'Integers should interpolate seamlessly.',
- 'data' =>
- array (
- 'mph' => 85,
- ),
- 'template' => '"{{&mph}} miles an hour!"',
- 'expected' => '"85 miles an hour!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"85\s*miles\s*an\s*hour\!"
View
25 tests/mustache-spec-interpolatio-ampersand-standalone.phpt
@@ -1,25 +0,0 @@
---TEST--
-Ampersand - Standalone
---DESCRIPTION--
-Standalone interpolation should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand - Standalone',
- 'desc' => 'Standalone interpolation should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => ' {{&string}}
-',
- 'expected' => ' ---
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*\-\-\-\s*
View
23 tests/mustache-spec-interpolatio-ampersand-surrounding-whitespace.phpt
@@ -1,23 +0,0 @@
---TEST--
-Ampersand - Surrounding Whitespace
---DESCRIPTION--
-Interpolation should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand - Surrounding Whitespace',
- 'desc' => 'Interpolation should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => '| {{&string}} |',
- 'expected' => '| --- |',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\s*\-\-\-\s*\|
View
23 tests/mustache-spec-interpolatio-ampersand-with-padding.phpt
@@ -1,23 +0,0 @@
---TEST--
-Ampersand With Padding
---DESCRIPTION--
-Superfluous in-tag whitespace should be ignored.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand With Padding',
- 'desc' => 'Superfluous in-tag whitespace should be ignored.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => '|{{& string }}|',
- 'expected' => '|---|',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\-\-\-\|
View
25 tests/mustache-spec-interpolatio-ampersand.phpt
@@ -1,25 +0,0 @@
---TEST--
-Ampersand
---DESCRIPTION--
-Ampersand should interpolate without HTML escaping.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Ampersand',
- 'desc' => 'Ampersand should interpolate without HTML escaping.',
- 'data' =>
- array (
- 'forbidden' => '& " < >',
- ),
- 'template' => 'These characters should not be HTML escaped: {{&forbidden}}
-',
- 'expected' => 'These characters should not be HTML escaped: & " < >
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-These\s*characters\s*should\s*not\s*be\s*HTML\s*escaped\:\s*&\s*"\s*\<\s*\>\s*
View
22 tests/mustache-spec-interpolatio-basic-context-miss-interpolation.phpt
@@ -1,22 +0,0 @@
---TEST--
-Basic Context Miss Interpolation
---DESCRIPTION--
-Failed context lookups should default to empty strings.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Basic Context Miss Interpolation',
- 'desc' => 'Failed context lookups should default to empty strings.',
- 'data' =>
- array (
- ),
- 'template' => 'I ({{cannot}}) be seen!',
- 'expected' => 'I () be seen!',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-I\s*\(\)\s*be\s*seen\!
View
23 tests/mustache-spec-interpolatio-basic-decimal-interpolation.phpt
@@ -1,23 +0,0 @@
---TEST--
-Basic Decimal Interpolation
---DESCRIPTION--
-Decimals should interpolate seamlessly with proper significance.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Basic Decimal Interpolation',
- 'desc' => 'Decimals should interpolate seamlessly with proper significance.',
- 'data' =>
- array (
- 'power' => 1.21,
- ),
- 'template' => '"{{power}} jiggawatts!"',
- 'expected' => '"1.21 jiggawatts!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"1\.21\s*jiggawatts\!"
View
23 tests/mustache-spec-interpolatio-basic-integer-interpolation.phpt
@@ -1,23 +0,0 @@
---TEST--
-Basic Integer Interpolation
---DESCRIPTION--
-Integers should interpolate seamlessly.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Basic Integer Interpolation',
- 'desc' => 'Integers should interpolate seamlessly.',
- 'data' =>
- array (
- 'mph' => 85,
- ),
- 'template' => '"{{mph}} miles an hour!"',
- 'expected' => '"85 miles an hour!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"85\s*miles\s*an\s*hour\!"
View
25 tests/mustache-spec-interpolatio-basic-interpolation.phpt
@@ -1,25 +0,0 @@
---TEST--
-Basic Interpolation
---DESCRIPTION--
-Unadorned tags should interpolate content into the template.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Basic Interpolation',
- 'desc' => 'Unadorned tags should interpolate content into the template.',
- 'data' =>
- array (
- 'subject' => 'world',
- ),
- 'template' => 'Hello, {{subject}}!
-',
- 'expected' => 'Hello, world!
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Hello,\s*world\!\s*
View
26 tests/mustache-spec-interpolatio-dotted-names-ampersand-interpolation.phpt
@@ -1,26 +0,0 @@
---TEST--
-Dotted Names - Ampersand Interpolation
---DESCRIPTION--
-Dotted names should be considered a form of shorthand for sections.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Ampersand Interpolation',
- 'desc' => 'Dotted names should be considered a form of shorthand for sections.',
- 'data' =>
- array (
- 'person' =>
- array (
- 'name' => 'Joe',
- ),
- ),
- 'template' => '"{{&person.name}}" == "{{#person}}{{&name}}{{/person}}"',
- 'expected' => '"Joe" == "Joe"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Joe"\s*\=\=\s*"Joe"
View
38 tests/mustache-spec-interpolatio-dotted-names-arbitrary-depth.phpt
@@ -1,38 +0,0 @@
---TEST--
-Dotted Names - Arbitrary Depth
---DESCRIPTION--
-Dotted names should be functional to any level of nesting.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Arbitrary Depth',
- 'desc' => 'Dotted names should be functional to any level of nesting.',
- 'data' =>
- array (
- 'a' =>
- array (
- 'b' =>
- array (
- 'c' =>
- array (
- 'd' =>
- array (
- 'e' =>
- array (
- 'name' => 'Phil',
- ),
- ),
- ),
- ),
- ),
- ),
- 'template' => '"{{a.b.c.d.e.name}}" == "Phil"',
- 'expected' => '"Phil" == "Phil"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Phil"\s*\=\=\s*"Phil"
View
26 tests/mustache-spec-interpolatio-dotted-names-basic-interpolation.phpt
@@ -1,26 +0,0 @@
---TEST--
-Dotted Names - Basic Interpolation
---DESCRIPTION--
-Dotted names should be considered a form of shorthand for sections.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Basic Interpolation',
- 'desc' => 'Dotted names should be considered a form of shorthand for sections.',
- 'data' =>
- array (
- 'person' =>
- array (
- 'name' => 'Joe',
- ),
- ),
- 'template' => '"{{person.name}}" == "{{#person}}{{name}}{{/person}}"',
- 'expected' => '"Joe" == "Joe"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Joe"\s*\=\=\s*"Joe"
View
32 tests/mustache-spec-interpolatio-dotted-names-broken-chain-resolution.phpt
@@ -1,32 +0,0 @@
---TEST--
-Dotted Names - Broken Chain Resolution
---DESCRIPTION--
-Each part of a dotted name should resolve only against its parent.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Broken Chain Resolution',
- 'desc' => 'Each part of a dotted name should resolve only against its parent.',
- 'data' =>
- array (
- 'a' =>
- array (
- 'b' =>
- array (
- ),
- ),
- 'c' =>
- array (
- 'name' => 'Jim',
- ),
- ),
- 'template' => '"{{a.b.c.name}}" == ""',
- 'expected' => '"" == ""',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-""\s*\=\=\s*""
View
25 tests/mustache-spec-interpolatio-dotted-names-broken-chains.phpt
@@ -1,25 +0,0 @@
---TEST--
-Dotted Names - Broken Chains
---DESCRIPTION--
-Any falsey value prior to the last part of the name should yield ''.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Broken Chains',
- 'desc' => 'Any falsey value prior to the last part of the name should yield \'\'.',
- 'data' =>
- array (
- 'a' =>
- array (
- ),
- ),
- 'template' => '"{{a.b.c}}" == ""',
- 'expected' => '"" == ""',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-""\s*\=\=\s*""
View
31 tests/mustache-spec-interpolatio-dotted-names-context-precedence.phpt
@@ -1,31 +0,0 @@
---TEST--
-Dotted Names - Context Precedence
---DESCRIPTION--
-Dotted names should be resolved against former resolutions.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Context Precedence',
- 'desc' => 'Dotted names should be resolved against former resolutions.',
- 'data' =>
- array (
- 'a' =>
- array (
- 'b' =>
- array (
- ),
- ),
- 'b' =>
- array (
- 'c' => 'ERROR',
- ),
- ),
- 'template' => '{{#a}}{{b.c}}{{/a}}',
- 'expected' => '',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
View
51 tests/mustache-spec-interpolatio-dotted-names-initial-resolution.phpt
@@ -1,51 +0,0 @@
---TEST--
-Dotted Names - Initial Resolution
---DESCRIPTION--
-The first part of a dotted name should resolve as any other name.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Initial Resolution',
- 'desc' => 'The first part of a dotted name should resolve as any other name.',
- 'data' =>
- array (
- 'a' =>
- array (
- 'b' =>
- array (
- 'c' =>
- array (
- 'd' =>
- array (
- 'e' =>
- array (
- 'name' => 'Phil',
- ),
- ),
- ),
- ),
- ),
- 'b' =>
- array (
- 'c' =>
- array (
- 'd' =>
- array (
- 'e' =>
- array (
- 'name' => 'Wrong',
- ),
- ),
- ),
- ),
- ),
- 'template' => '"{{#a}}{{b.c.d.e.name}}{{/a}}" == "Phil"',
- 'expected' => '"Phil" == "Phil"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Phil"\s*\=\=\s*"Phil"
View
26 tests/mustache-spec-interpolatio-dotted-names-triple-mustache-interpolation.phpt
@@ -1,26 +0,0 @@
---TEST--
-Dotted Names - Triple Mustache Interpolation
---DESCRIPTION--
-Dotted names should be considered a form of shorthand for sections.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Triple Mustache Interpolation',
- 'desc' => 'Dotted names should be considered a form of shorthand for sections.',
- 'data' =>
- array (
- 'person' =>
- array (
- 'name' => 'Joe',
- ),
- ),
- 'template' => '"{{{person.name}}}" == "{{#person}}{{{name}}}{{/person}}"',
- 'expected' => '"Joe" == "Joe"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Joe"\s*\=\=\s*"Joe"
View
25 tests/mustache-spec-interpolatio-html-escaping.phpt
@@ -1,25 +0,0 @@
---TEST--
-HTML Escaping
---DESCRIPTION--
-Basic interpolation should be HTML escaped.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'HTML Escaping',
- 'desc' => 'Basic interpolation should be HTML escaped.',
- 'data' =>
- array (
- 'forbidden' => '& " < >',
- ),
- 'template' => 'These characters should be HTML escaped: {{forbidden}}
-',
- 'expected' => 'These characters should be HTML escaped: &amp; &quot; &lt; &gt;
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-These\s*characters\s*should\s*be\s*HTML\s*escaped\:\s*&amp;\s*&quot;\s*&lt;\s*&gt;\s*
View
25 tests/mustache-spec-interpolatio-interpolation-standalone.phpt
@@ -1,25 +0,0 @@
---TEST--
-Interpolation - Standalone
---DESCRIPTION--
-Standalone interpolation should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Interpolation - Standalone',
- 'desc' => 'Standalone interpolation should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => ' {{string}}
-',
- 'expected' => ' ---
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*\-\-\-\s*
View
23 tests/mustache-spec-interpolatio-interpolation-surrounding-whitespace.phpt
@@ -1,23 +0,0 @@
---TEST--
-Interpolation - Surrounding Whitespace
---DESCRIPTION--
-Interpolation should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Interpolation - Surrounding Whitespace',
- 'desc' => 'Interpolation should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => '| {{string}} |',
- 'expected' => '| --- |',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\s*\-\-\-\s*\|
View
23 tests/mustache-spec-interpolatio-interpolation-with-padding.phpt
@@ -1,23 +0,0 @@
---TEST--
-Interpolation With Padding
---DESCRIPTION--
-Superfluous in-tag whitespace should be ignored.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Interpolation With Padding',
- 'desc' => 'Superfluous in-tag whitespace should be ignored.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => '|{{ string }}|',
- 'expected' => '|---|',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\-\-\-\|
View
24 tests/mustache-spec-interpolatio-no-interpolation.phpt
@@ -1,24 +0,0 @@
---TEST--
-No Interpolation
---DESCRIPTION--
-Mustache-free templates should render as-is.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'No Interpolation',
- 'desc' => 'Mustache-free templates should render as-is.',
- 'data' =>
- array (
- ),
- 'template' => 'Hello from {Mustache}!
-',
- 'expected' => 'Hello from {Mustache}!
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-Hello\s*from\s*\{Mustache\}\!\s*
View
22 tests/mustache-spec-interpolatio-triple-mustache-context-miss-interpolation.phpt
@@ -1,22 +0,0 @@
---TEST--
-Triple Mustache Context Miss Interpolation
---DESCRIPTION--
-Failed context lookups should default to empty strings.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache Context Miss Interpolation',
- 'desc' => 'Failed context lookups should default to empty strings.',
- 'data' =>
- array (
- ),
- 'template' => 'I ({{{cannot}}}) be seen!',
- 'expected' => 'I () be seen!',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-I\s*\(\)\s*be\s*seen\!
View
23 tests/mustache-spec-interpolatio-triple-mustache-decimal-interpolation.phpt
@@ -1,23 +0,0 @@
---TEST--
-Triple Mustache Decimal Interpolation
---DESCRIPTION--
-Decimals should interpolate seamlessly with proper significance.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache Decimal Interpolation',
- 'desc' => 'Decimals should interpolate seamlessly with proper significance.',
- 'data' =>
- array (
- 'power' => 1.21,
- ),
- 'template' => '"{{{power}}} jiggawatts!"',
- 'expected' => '"1.21 jiggawatts!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"1\.21\s*jiggawatts\!"
View
23 tests/mustache-spec-interpolatio-triple-mustache-integer-interpolation.phpt
@@ -1,23 +0,0 @@
---TEST--
-Triple Mustache Integer Interpolation
---DESCRIPTION--
-Integers should interpolate seamlessly.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache Integer Interpolation',
- 'desc' => 'Integers should interpolate seamlessly.',
- 'data' =>
- array (
- 'mph' => 85,
- ),
- 'template' => '"{{{mph}}} miles an hour!"',
- 'expected' => '"85 miles an hour!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"85\s*miles\s*an\s*hour\!"
View
25 tests/mustache-spec-interpolatio-triple-mustache-standalone.phpt
@@ -1,25 +0,0 @@
---TEST--
-Triple Mustache - Standalone
---DESCRIPTION--
-Standalone interpolation should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache - Standalone',
- 'desc' => 'Standalone interpolation should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => ' {{{string}}}
-',
- 'expected' => ' ---
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*\-\-\-\s*
View
23 tests/mustache-spec-interpolatio-triple-mustache-surrounding-whitespace.phpt
@@ -1,23 +0,0 @@
---TEST--
-Triple Mustache - Surrounding Whitespace
---DESCRIPTION--
-Interpolation should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache - Surrounding Whitespace',
- 'desc' => 'Interpolation should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => '| {{{string}}} |',
- 'expected' => '| --- |',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\s*\-\-\-\s*\|
View
23 tests/mustache-spec-interpolatio-triple-mustache-with-padding.phpt
@@ -1,23 +0,0 @@
---TEST--
-Triple Mustache With Padding
---DESCRIPTION--
-Superfluous in-tag whitespace should be ignored.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache With Padding',
- 'desc' => 'Superfluous in-tag whitespace should be ignored.',
- 'data' =>
- array (
- 'string' => '---',
- ),
- 'template' => '|{{{ string }}}|',
- 'expected' => '|---|',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\|\-\-\-\|
View
25 tests/mustache-spec-interpolatio-triple-mustache.phpt
@@ -1,25 +0,0 @@
---TEST--
-Triple Mustache
---DESCRIPTION--
-Triple mustaches should interpolate without HTML escaping.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Triple Mustache',
- 'desc' => 'Triple mustaches should interpolate without HTML escaping.',
- 'data' =>
- array (
- 'forbidden' => '& " < >',
- ),
- 'template' => 'These characters should not be HTML escaped: {{{forbidden}}}
-',
- 'expected' => 'These characters should not be HTML escaped: & " < >
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-These\s*characters\s*should\s*not\s*be\s*HTML\s*escaped\:\s*&\s*"\s*\<\s*\>\s*
View
22 tests/mustache-spec-inverte-context-misses.phpt
@@ -1,22 +0,0 @@
---TEST--
-Context Misses
---DESCRIPTION--
-Failed context lookups should be considered falsey.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Context Misses',
- 'desc' => 'Failed context lookups should be considered falsey.',
- 'data' =>
- array (
- ),
- 'template' => '[{{^missing}}Cannot find key \'missing\'!{{/missing}}]',
- 'expected' => '[Cannot find key \'missing\'!]',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\[Cannot\s*find\s*key\s*'missing'\!\]
View
26 tests/mustache-spec-inverte-context.phpt
@@ -1,26 +0,0 @@
---TEST--
-Context
---DESCRIPTION--
-Objects and hashes should behave like truthy values.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Context',
- 'desc' => 'Objects and hashes should behave like truthy values.',
- 'data' =>
- array (
- 'context' =>
- array (
- 'name' => 'Joe',
- ),
- ),
- 'template' => '"{{^context}}Hi {{name}}.{{/context}}"',
- 'expected' => '""',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-""
View
25 tests/mustache-spec-inverte-dotted-names-broken-chains.phpt
@@ -1,25 +0,0 @@
---TEST--
-Dotted Names - Broken Chains
---DESCRIPTION--
-Dotted names that cannot be resolved should be considered falsey.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Broken Chains',
- 'desc' => 'Dotted names that cannot be resolved should be considered falsey.',
- 'data' =>
- array (
- 'a' =>
- array (
- ),
- ),
- 'template' => '"{{^a.b.c}}Not Here{{/a.b.c}}" == "Not Here"',
- 'expected' => '"Not Here" == "Not Here"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Not\s*Here"\s*\=\=\s*"Not\s*Here"
View
29 tests/mustache-spec-inverte-dotted-names-falsey.phpt
@@ -1,29 +0,0 @@
---TEST--
-Dotted Names - Falsey
---DESCRIPTION--
-Dotted names should be valid for Inverted Section tags.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Falsey',
- 'desc' => 'Dotted names should be valid for Inverted Section tags.',
- 'data' =>
- array (
- 'a' =>
- array (
- 'b' =>
- array (
- 'c' => false,
- ),
- ),
- ),
- 'template' => '"{{^a.b.c}}Not Here{{/a.b.c}}" == "Not Here"',
- 'expected' => '"Not Here" == "Not Here"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Not\s*Here"\s*\=\=\s*"Not\s*Here"
View
29 tests/mustache-spec-inverte-dotted-names-truthy.phpt
@@ -1,29 +0,0 @@
---TEST--
-Dotted Names - Truthy
---DESCRIPTION--
-Dotted names should be valid for Inverted Section tags.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Dotted Names - Truthy',
- 'desc' => 'Dotted names should be valid for Inverted Section tags.',
- 'data' =>
- array (
- 'a' =>
- array (
- 'b' =>
- array (
- 'c' => true,
- ),
- ),
- ),
- 'template' => '"{{^a.b.c}}Not Here{{/a.b.c}}" == ""',
- 'expected' => '"" == ""',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-""\s*\=\=\s*""
View
34 tests/mustache-spec-inverte-doubled.phpt
@@ -1,34 +0,0 @@
---TEST--
-Doubled
---DESCRIPTION--
-Multiple inverted sections per template should be permitted.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Doubled',
- 'desc' => 'Multiple inverted sections per template should be permitted.',
- 'data' =>
- array (
- 'bool' => false,
- 'two' => 'second',
- ),
- 'template' => '{{^bool}}
-* first
-{{/bool}}
-* {{two}}
-{{^bool}}
-* third
-{{/bool}}
-',
- 'expected' => '* first
-* second
-* third
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\*\s*first\s*\*\s*second\s*\*\s*third\s*
View
25 tests/mustache-spec-inverte-empty-list.phpt
@@ -1,25 +0,0 @@
---TEST--
-Empty List
---DESCRIPTION--
-Empty lists should behave like falsey values.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Empty List',
- 'desc' => 'Empty lists should behave like falsey values.',
- 'data' =>
- array (
- 'list' =>
- array (
- ),
- ),
- 'template' => '"{{^list}}Yay lists!{{/list}}"',
- 'expected' => '"Yay lists!"',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"Yay\s*lists\!"
View
23 tests/mustache-spec-inverte-falsey.phpt
@@ -1,23 +0,0 @@
---TEST--
-Falsey
---DESCRIPTION--
-Falsey sections should have their contents rendered.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Falsey',
- 'desc' => 'Falsey sections should have their contents rendered.',
- 'data' =>
- array (
- 'boolean' => false,
- ),
- 'template' => '"{{^boolean}}This should be rendered.{{/boolean}}"',
- 'expected' => '"This should be rendered."',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-"This\s*should\s*be\s*rendered\."
View
27 tests/mustache-spec-inverte-indented-inline-sections.phpt
@@ -1,27 +0,0 @@
---TEST--
-Indented Inline Sections
---DESCRIPTION--
-Single-line sections should not alter surrounding whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Indented Inline Sections',
- 'desc' => 'Single-line sections should not alter surrounding whitespace.',
- 'data' =>
- array (
- 'boolean' => false,
- ),
- 'template' => ' {{^boolean}}NO{{/boolean}}
- {{^boolean}}WAY{{/boolean}}
-',
- 'expected' => ' NO
- WAY
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*NO\s*WAY\s*
View
27 tests/mustache-spec-inverte-internal-whitespace.phpt
@@ -1,27 +0,0 @@
---TEST--
-Internal Whitespace
---DESCRIPTION--
-Inverted should not alter internal whitespace.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'Internal Whitespace',
- 'desc' => 'Inverted should not alter internal whitespace.',
- 'data' =>
- array (
- 'boolean' => false,
- ),
- 'template' => ' | {{^boolean}} {{! Important Whitespace }}
- {{/boolean}} |
-',
- 'expected' => ' |
- |
-',
-);
-$mustache = new Mustache();
-echo $mustache->render($test["template"], $test["data"]);
-?>
---EXPECTREGEX--
-\s*\|\s*\|\s*
View
37 tests/mustache-spec-inverte-list.phpt
@@ -1,37 +0,0 @@
---TEST--
-List
---DESCRIPTION--
-Lists should behave like truthy values.
---SKIPIF--
-<?php if(!extension_loaded('mustache')) die('skip '); ?>
---FILE--
-<?php
-$test = array (
- 'name' => 'List',
- 'desc' => 'Lists should behave like truthy values.',
- 'data' =>
- array (