Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing Tests fom PHPTAL if you want the full framework see at www.p…

  • Loading branch information...
commit 3b849f58270c03d8d91808323c019d2ec783baeb 1 parent 1c68af1
Klederson Bueno authored
Showing with 0 additions and 9,523 deletions.
  1. +0 −63 app/libs/Addons/PHPTAL/tests/ArrayOverloadTest.php
  2. +0 −151 app/libs/Addons/PHPTAL/tests/AttributesInterpolationTest.php
  3. +0 −56 app/libs/Addons/PHPTAL/tests/BlockTest.php
  4. +0 −158 app/libs/Addons/PHPTAL/tests/CodeCacheTest.php
  5. +0 −55 app/libs/Addons/PHPTAL/tests/CommentFilterTest.php
  6. +0 −94 app/libs/Addons/PHPTAL/tests/CommentTest.php
  7. +0 −37 app/libs/Addons/PHPTAL/tests/ContentEncodingTest.php
  8. +0 −164 app/libs/Addons/PHPTAL/tests/ContentInterpolationTest.php
  9. +0 −84 app/libs/Addons/PHPTAL/tests/DoctypeTest.php
  10. +0 −129 app/libs/Addons/PHPTAL/tests/DomTest.php
  11. +0 −73 app/libs/Addons/PHPTAL/tests/EchoExecuteTest.php
  12. +0 −165 app/libs/Addons/PHPTAL/tests/EscapeCDATATest.php
  13. +0 −201 app/libs/Addons/PHPTAL/tests/EscapeHTMLTest.php
  14. +0 −168 app/libs/Addons/PHPTAL/tests/GetTextTest.php
  15. +0 −170 app/libs/Addons/PHPTAL/tests/HTML5ModeTest.php
  16. +0 −39 app/libs/Addons/PHPTAL/tests/HTMLGeneratorTest.php
  17. +0 −112 app/libs/Addons/PHPTAL/tests/I18NAttributesTest.php
  18. +0 −59 app/libs/Addons/PHPTAL/tests/I18NDummyTranslator.php
  19. +0 −83 app/libs/Addons/PHPTAL/tests/I18NNameTest.php
  20. +0 −79 app/libs/Addons/PHPTAL/tests/I18NTranslateTest.php
  21. +0 −91 app/libs/Addons/PHPTAL/tests/IncludePathTest.php
  22. +0 −44 app/libs/Addons/PHPTAL/tests/Latin1Test.php
  23. +0 −189 app/libs/Addons/PHPTAL/tests/MetalMacroTest.php
  24. +0 −198 app/libs/Addons/PHPTAL/tests/MetalSlotTest.php
  25. +0 −104 app/libs/Addons/PHPTAL/tests/NamespacesTest.php
  26. +0 −207 app/libs/Addons/PHPTAL/tests/OldTest.php
  27. +0 −59 app/libs/Addons/PHPTAL/tests/OverloadingTest.php
  28. +0 −98 app/libs/Addons/PHPTAL/tests/ParserTest.php
  29. +0 −39 app/libs/Addons/PHPTAL/tests/PhpModeTest.php
  30. +0 −150 app/libs/Addons/PHPTAL/tests/PhpTransformerTest.php
  31. +0 −172 app/libs/Addons/PHPTAL/tests/PhptalCacheTest.php
  32. +0 −74 app/libs/Addons/PHPTAL/tests/PhptalIdTest.php
  33. +0 −90 app/libs/Addons/PHPTAL/tests/PhptalPathTest.php
  34. +0 −191 app/libs/Addons/PHPTAL/tests/PhptalTest.php
  35. +0 −44 app/libs/Addons/PHPTAL/tests/PhptalUsageTest.php
  36. +0 −61 app/libs/Addons/PHPTAL/tests/PostFilterTest.php
  37. +0 −144 app/libs/Addons/PHPTAL/tests/PreFilterNormalizeTest.php
  38. +0 −85 app/libs/Addons/PHPTAL/tests/PreFilterTest.php
  39. +0 −72 app/libs/Addons/PHPTAL/tests/ReadableErrorTest.php
  40. +0 −95 app/libs/Addons/PHPTAL/tests/SimpleGenerationTest.php
  41. +0 −191 app/libs/Addons/PHPTAL/tests/TalAttributesTest.php
  42. +0 −96 app/libs/Addons/PHPTAL/tests/TalCommentTest.php
  43. +0 −90 app/libs/Addons/PHPTAL/tests/TalConditionTest.php
  44. +0 −202 app/libs/Addons/PHPTAL/tests/TalContentTest.php
  45. +0 −366 app/libs/Addons/PHPTAL/tests/TalDefineTest.php
  46. +0 −66 app/libs/Addons/PHPTAL/tests/TalOmitTagTest.php
  47. +0 −67 app/libs/Addons/PHPTAL/tests/TalOnErrorTest.php
  48. +0 −432 app/libs/Addons/PHPTAL/tests/TalRepeatTest.php
  49. +0 −107 app/libs/Addons/PHPTAL/tests/TalReplaceTest.php
  50. +0 −46 app/libs/Addons/PHPTAL/tests/TalesExistTest.php
  51. +0 −56 app/libs/Addons/PHPTAL/tests/TalesIssetNullTest.php
  52. +0 −32 app/libs/Addons/PHPTAL/tests/TalesModeTest.php
  53. +0 −37 app/libs/Addons/PHPTAL/tests/TalesPhpTest.php
  54. +0 −29 app/libs/Addons/PHPTAL/tests/TalesPhpWithReplaceTest.php
  55. +0 −102 app/libs/Addons/PHPTAL/tests/TalesStringTest.php
  56. +0 −149 app/libs/Addons/PHPTAL/tests/TalesTest.php
  57. +0 −50 app/libs/Addons/PHPTAL/tests/TemplateRepositoryTest.php
  58. +0 −102 app/libs/Addons/PHPTAL/tests/TriggerTest.php
  59. +0 −361 app/libs/Addons/PHPTAL/tests/UTF8Test.php
  60. +0 −139 app/libs/Addons/PHPTAL/tests/XHTMLModeTest.php
  61. +0 −359 app/libs/Addons/PHPTAL/tests/XmlParserTest.php
  62. +0 −95 app/libs/Addons/PHPTAL/tests/config.php
  63. +0 −7 app/libs/Addons/PHPTAL/tests/gen-mos.sh
  64. +0 −1  app/libs/Addons/PHPTAL/tests/input/array-overload.01.html
  65. +0 −1  app/libs/Addons/PHPTAL/tests/input/code-cache-01.html
  66. +0 −9 app/libs/Addons/PHPTAL/tests/input/comment-filter-01.html
  67. +0 −3  app/libs/Addons/PHPTAL/tests/input/content-encoding.xml
  68. +0 −6 app/libs/Addons/PHPTAL/tests/input/doctype.01.html
  69. +0 −6 app/libs/Addons/PHPTAL/tests/input/doctype.02.html
  70. +0 −2  app/libs/Addons/PHPTAL/tests/input/doctype.02.user.html
  71. +0 −1  app/libs/Addons/PHPTAL/tests/input/doctype.03.html
  72. +0 −3  app/libs/Addons/PHPTAL/tests/input/doctype.03.sub1.html
  73. +0 −6 app/libs/Addons/PHPTAL/tests/input/doctype.03.sub2.html
  74. +0 −9 app/libs/Addons/PHPTAL/tests/input/doctype.04.html
  75. +0 −3  app/libs/Addons/PHPTAL/tests/input/error-01.html
  76. +0 −3  app/libs/Addons/PHPTAL/tests/input/error-02.html
  77. +0 −3  app/libs/Addons/PHPTAL/tests/input/error-02.macro.html
  78. +0 −4 app/libs/Addons/PHPTAL/tests/input/error-03.html
  79. +0 −5 app/libs/Addons/PHPTAL/tests/input/error-03.macro.html
  80. +0 −16 app/libs/Addons/PHPTAL/tests/input/escape.html
  81. +0 −1  app/libs/Addons/PHPTAL/tests/input/gettext.01.html
  82. +0 −1  app/libs/Addons/PHPTAL/tests/input/gettext.02.html
  83. +0 −1  app/libs/Addons/PHPTAL/tests/input/gettext.03.html
  84. +0 −1  app/libs/Addons/PHPTAL/tests/input/gettext.04.html
  85. +0 −3  app/libs/Addons/PHPTAL/tests/input/gettext.05.html
  86. +0 −6 app/libs/Addons/PHPTAL/tests/input/gettext.06.html
  87. +0 −1  app/libs/Addons/PHPTAL/tests/input/gettext.07.html
  88. +0 −3  app/libs/Addons/PHPTAL/tests/input/i18n-attributes-01.html
  89. +0 −3  app/libs/Addons/PHPTAL/tests/input/i18n-attributes-02.html
  90. +0 −6 app/libs/Addons/PHPTAL/tests/input/i18n-attributes-03.html
  91. +0 −7 app/libs/Addons/PHPTAL/tests/input/i18n-attributes-04.html
  92. +0 −1  app/libs/Addons/PHPTAL/tests/input/i18n-attributes-05.html
  93. +0 −1  app/libs/Addons/PHPTAL/tests/input/i18n-name-01.html
  94. +0 −3  app/libs/Addons/PHPTAL/tests/input/i18n-name-02.html
  95. +0 −5 app/libs/Addons/PHPTAL/tests/input/i18n-name-03.html
  96. +0 −5 app/libs/Addons/PHPTAL/tests/input/i18n-name-04.html
  97. +0 −5 app/libs/Addons/PHPTAL/tests/input/i18n-name-05.html
  98. +0 −11 app/libs/Addons/PHPTAL/tests/input/i18n-name-06.html
  99. +0 −1  app/libs/Addons/PHPTAL/tests/input/i18n-translate-01.html
  100. +0 −1  app/libs/Addons/PHPTAL/tests/input/i18n-translate-02.html
  101. +0 −18 app/libs/Addons/PHPTAL/tests/input/metal-macro.01.html
  102. +0 −6 app/libs/Addons/PHPTAL/tests/input/metal-macro.02.html
  103. +0 −11 app/libs/Addons/PHPTAL/tests/input/metal-macro.03.html
  104. +0 −11 app/libs/Addons/PHPTAL/tests/input/metal-macro.04.html
  105. +0 −3  app/libs/Addons/PHPTAL/tests/input/metal-macro.04.main.html
  106. +0 −7 app/libs/Addons/PHPTAL/tests/input/metal-macro.05.html
  107. +0 −7 app/libs/Addons/PHPTAL/tests/input/metal-macro.06.html
  108. +0 −8 app/libs/Addons/PHPTAL/tests/input/metal-macro.07.html
  109. +0 −1  app/libs/Addons/PHPTAL/tests/input/metal-macro.08.html
  110. +0 −9 app/libs/Addons/PHPTAL/tests/input/metal-macro.09.html
  111. +0 −3  app/libs/Addons/PHPTAL/tests/input/metal-macro.10.html
  112. +0 −1  app/libs/Addons/PHPTAL/tests/input/metal-macro.11.html
  113. +0 −17 app/libs/Addons/PHPTAL/tests/input/metal-slot.01.html
  114. +0 −21 app/libs/Addons/PHPTAL/tests/input/metal-slot.02.html
  115. +0 −9 app/libs/Addons/PHPTAL/tests/input/metal-slot.03.html
  116. +0 −15 app/libs/Addons/PHPTAL/tests/input/metal-slot.04.html
  117. +0 −19 app/libs/Addons/PHPTAL/tests/input/metal-slot.05.html
  118. +0 −1  app/libs/Addons/PHPTAL/tests/input/multiuse.01.html
  119. +0 −1  app/libs/Addons/PHPTAL/tests/input/multiuse.02.html
  120. +0 −8 app/libs/Addons/PHPTAL/tests/input/namespaces.01.html
  121. +0 −11 app/libs/Addons/PHPTAL/tests/input/namespaces.02.html
  122. +0 −12 app/libs/Addons/PHPTAL/tests/input/namespaces.03.html
  123. +0 −33 app/libs/Addons/PHPTAL/tests/input/old-03.html
  124. +0 −12 app/libs/Addons/PHPTAL/tests/input/old-06.html
  125. +0 −11 app/libs/Addons/PHPTAL/tests/input/old-08-mcr.html
  126. +0 −9 app/libs/Addons/PHPTAL/tests/input/old-08.html
  127. +0 −3  app/libs/Addons/PHPTAL/tests/input/old-11.html
  128. +0 −9 app/libs/Addons/PHPTAL/tests/input/old-12.html
  129. +0 −40 app/libs/Addons/PHPTAL/tests/input/old-13.html
  130. +0 −11 app/libs/Addons/PHPTAL/tests/input/old-15.html
  131. +0 −56 app/libs/Addons/PHPTAL/tests/input/old-16.html
  132. +0 −11 app/libs/Addons/PHPTAL/tests/input/old-17.html
  133. +0 −6 app/libs/Addons/PHPTAL/tests/input/old-19.html
  134. +0 −8 app/libs/Addons/PHPTAL/tests/input/old-20.html
  135. +0 −17 app/libs/Addons/PHPTAL/tests/input/old-21.html
  136. +0 −4 app/libs/Addons/PHPTAL/tests/input/old-23.html
  137. +0 −8 app/libs/Addons/PHPTAL/tests/input/old-29-mcr.html
  138. +0 −2  app/libs/Addons/PHPTAL/tests/input/old-29.html
  139. +0 −12 app/libs/Addons/PHPTAL/tests/input/old-30.html
  140. +0 −5 app/libs/Addons/PHPTAL/tests/input/old-31.html
  141. +0 −9 app/libs/Addons/PHPTAL/tests/input/old-32.html
  142. +0 −5 app/libs/Addons/PHPTAL/tests/input/overloading-01.html
  143. +0 −10 app/libs/Addons/PHPTAL/tests/input/parser.01.xml
  144. +0 −2  app/libs/Addons/PHPTAL/tests/input/parser.02.xml
  145. +0 −6 app/libs/Addons/PHPTAL/tests/input/parser.03.xml
  146. +0 −4 app/libs/Addons/PHPTAL/tests/input/php-mode.01.xml
  147. +0 −3  app/libs/Addons/PHPTAL/tests/input/php-mode.02.xml
  148. +0 −14 app/libs/Addons/PHPTAL/tests/input/php.html
  149. +0 −1  app/libs/Addons/PHPTAL/tests/input/phptal.01.html
  150. +0 −8 app/libs/Addons/PHPTAL/tests/input/phptal.02.html
  151. +0 −7 app/libs/Addons/PHPTAL/tests/input/phptal.03.html
  152. +0 −4 app/libs/Addons/PHPTAL/tests/input/phptal.04.html
  153. +0 −1  app/libs/Addons/PHPTAL/tests/input/phptal.05.html
  154. +0 −1  app/libs/Addons/PHPTAL/tests/input/phptal.06.html
  155. +0 −18 app/libs/Addons/PHPTAL/tests/input/phptal.id.01.html
  156. +0 −3  app/libs/Addons/PHPTAL/tests/input/postfilter.01.html
  157. +0 −7 app/libs/Addons/PHPTAL/tests/input/prefilter.01.html
  158. +0 −1  app/libs/Addons/PHPTAL/tests/input/prefilter.02.html
  159. +0 −5 app/libs/Addons/PHPTAL/tests/input/prefilter.02.macro.html
  160. +0 −3  app/libs/Addons/PHPTAL/tests/input/prefilter.03.html
  161. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.01.html
  162. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.02.html
  163. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.03.html
  164. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.04.html
  165. +0 −2  app/libs/Addons/PHPTAL/tests/input/tal-attributes.05.html
  166. +0 −2  app/libs/Addons/PHPTAL/tests/input/tal-attributes.06.html
  167. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.07.html
  168. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.08.html
  169. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.09.html
  170. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-attributes.10.html
  171. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-comment.01.html
  172. +0 −6 app/libs/Addons/PHPTAL/tests/input/tal-comment.02.html
  173. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-condition.01.html
  174. +0 −2  app/libs/Addons/PHPTAL/tests/input/tal-condition.02.html
  175. +0 −2  app/libs/Addons/PHPTAL/tests/input/tal-condition.03.html
  176. +0 −6 app/libs/Addons/PHPTAL/tests/input/tal-condition.04.html
  177. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-content.01.html
  178. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-content.02.html
  179. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-content.03.html
  180. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-content.04.html
  181. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-content.05.html
  182. +0 −2  app/libs/Addons/PHPTAL/tests/input/tal-content.06.html
  183. +0 −6 app/libs/Addons/PHPTAL/tests/input/tal-define.01.html
  184. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-define.02.html
  185. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-define.03.html
  186. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-define.04.html
  187. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-define.05.html
  188. +0 −8 app/libs/Addons/PHPTAL/tests/input/tal-define.06.html
  189. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-define.07.html
  190. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-define.08.html
  191. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-define.09.html
  192. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-define.10.html
  193. +0 −9 app/libs/Addons/PHPTAL/tests/input/tal-define.11.html
  194. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-define.12.html
  195. +0 −7 app/libs/Addons/PHPTAL/tests/input/tal-define.13.html
  196. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-define.14.html
  197. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-omit-tag.01.html
  198. +0 −5 app/libs/Addons/PHPTAL/tests/input/tal-omit-tag.02.html
  199. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-on-error.01.html
  200. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-on-error.02.html
  201. +0 −11 app/libs/Addons/PHPTAL/tests/input/tal-on-error.03.html
  202. +0 −4 app/libs/Addons/PHPTAL/tests/input/tal-repeat.01.html
  203. +0 −10 app/libs/Addons/PHPTAL/tests/input/tal-repeat.02.html
  204. +0 −10 app/libs/Addons/PHPTAL/tests/input/tal-repeat.03.html
  205. +0 −11 app/libs/Addons/PHPTAL/tests/input/tal-repeat.04.html
  206. +0 −3  app/libs/Addons/PHPTAL/tests/input/tal-repeat.05.html
  207. +0 −10 app/libs/Addons/PHPTAL/tests/input/tal-repeat.06.html
  208. +0 −11 app/libs/Addons/PHPTAL/tests/input/tal-repeat.07.html
  209. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-replace.01.html
  210. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-replace.02.html
  211. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-replace.03.html
  212. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-replace.04.html
  213. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-replace.05.html
  214. +0 −1  app/libs/Addons/PHPTAL/tests/input/tal-replace.06.html
  215. +0 −5 app/libs/Addons/PHPTAL/tests/input/tal-replace.07.html
  216. +0 −6 app/libs/Addons/PHPTAL/tests/input/tales-exist-01.html
  217. +0 −4 app/libs/Addons/PHPTAL/tests/input/tales-exist-02.html
  218. +0 −4 app/libs/Addons/PHPTAL/tests/input/tales-string-01.html
  219. +0 −2  app/libs/Addons/PHPTAL/tests/input/tales-string-02.html
  220. +0 −6 app/libs/Addons/PHPTAL/tests/input/tales-string-03.html
  221. +0 −5 app/libs/Addons/PHPTAL/tests/input/tales-true.html
  222. +0 −1  app/libs/Addons/PHPTAL/tests/input/tales.mode.01.xml
  223. +0 −3  app/libs/Addons/PHPTAL/tests/input/talesphpwithreplace.01.html
  224. +0 −7 app/libs/Addons/PHPTAL/tests/input/trigger.01.html
  225. +0 −425 app/libs/Addons/PHPTAL/tests/input/utf8.xml
  226. +0 −27 app/libs/Addons/PHPTAL/tests/input/xml.01.xml
  227. +0 −4 app/libs/Addons/PHPTAL/tests/input/xml.02.xml
  228. +0 −11 app/libs/Addons/PHPTAL/tests/input/xml.03.xml
  229. +0 −16 app/libs/Addons/PHPTAL/tests/input/xml.04.xml
  230. BIN  app/libs/Addons/PHPTAL/tests/locale/en_GB/LC_MESSAGES/test.mo
  231. +0 −12 app/libs/Addons/PHPTAL/tests/locale/en_GB/LC_MESSAGES/test.php
  232. +0 −35 app/libs/Addons/PHPTAL/tests/locale/en_GB/LC_MESSAGES/test.po
  233. BIN  app/libs/Addons/PHPTAL/tests/locale/en_GB/LC_MESSAGES/test2.mo
  234. +0 −17 app/libs/Addons/PHPTAL/tests/locale/en_GB/LC_MESSAGES/test2.po
  235. BIN  app/libs/Addons/PHPTAL/tests/locale/es_ES/LC_MESSAGES/test.mo
  236. +0 −19 app/libs/Addons/PHPTAL/tests/locale/es_ES/LC_MESSAGES/test.po
  237. BIN  app/libs/Addons/PHPTAL/tests/locale/fr_FR/LC_MESSAGES/test.mo
  238. +0 −18 app/libs/Addons/PHPTAL/tests/locale/fr_FR/LC_MESSAGES/test.php
  239. +0 −29 app/libs/Addons/PHPTAL/tests/locale/fr_FR/LC_MESSAGES/test.po
  240. BIN  app/libs/Addons/PHPTAL/tests/locale/fr_FR/LC_MESSAGES/test2.mo
  241. +0 −18 app/libs/Addons/PHPTAL/tests/locale/fr_FR/LC_MESSAGES/test2.php
  242. +0 −23 app/libs/Addons/PHPTAL/tests/locale/fr_FR/LC_MESSAGES/test2.po
  243. +0 −1  app/libs/Addons/PHPTAL/tests/output/array-overload.01.html
  244. +0 −5 app/libs/Addons/PHPTAL/tests/output/comment-filter-01.html
  245. +0 −3  app/libs/Addons/PHPTAL/tests/output/content-encoding.xml
  246. +0 −6 app/libs/Addons/PHPTAL/tests/output/doctype.01.html
  247. +0 −6 app/libs/Addons/PHPTAL/tests/output/doctype.02.html
  248. +0 −6 app/libs/Addons/PHPTAL/tests/output/doctype.03.html
  249. +0 −9 app/libs/Addons/PHPTAL/tests/output/doctype.04.html
  250. +0 −16 app/libs/Addons/PHPTAL/tests/output/escape.html
  251. +0 −1  app/libs/Addons/PHPTAL/tests/output/gettext.01.html
  252. +0 −1  app/libs/Addons/PHPTAL/tests/output/gettext.02.html
  253. +0 −1  app/libs/Addons/PHPTAL/tests/output/gettext.03.html
  254. +0 −1  app/libs/Addons/PHPTAL/tests/output/gettext.04.html
  255. +0 −3  app/libs/Addons/PHPTAL/tests/output/gettext.05.html
  256. +0 −5 app/libs/Addons/PHPTAL/tests/output/gettext.06.html
  257. +0 −1  app/libs/Addons/PHPTAL/tests/output/gettext.07.html
  258. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-attributes-01.html
  259. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-attributes-02.html
  260. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-attributes-03.html
  261. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-attributes-04.html
  262. +0 −1  app/libs/Addons/PHPTAL/tests/output/i18n-attributes-05.html
  263. +0 −1  app/libs/Addons/PHPTAL/tests/output/i18n-name-02.html
  264. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-name-03.html
  265. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-name-04.html
  266. +0 −3  app/libs/Addons/PHPTAL/tests/output/i18n-name-05.html
  267. +0 −8 app/libs/Addons/PHPTAL/tests/output/i18n-name-06.html
  268. +0 −1  app/libs/Addons/PHPTAL/tests/output/i18n-translate-01.html
  269. +0 −1  app/libs/Addons/PHPTAL/tests/output/i18n-translate-02.html
  270. +0 −4 app/libs/Addons/PHPTAL/tests/output/metal-macro.01.html
  271. +0 −6 app/libs/Addons/PHPTAL/tests/output/metal-macro.02.html
  272. +0 −8 app/libs/Addons/PHPTAL/tests/output/metal-macro.03.html
  273. +0 −3  app/libs/Addons/PHPTAL/tests/output/metal-macro.04.html
  274. +0 −4 app/libs/Addons/PHPTAL/tests/output/metal-macro.05.html
  275. +0 −4 app/libs/Addons/PHPTAL/tests/output/metal-macro.06.html
  276. +0 −1  app/libs/Addons/PHPTAL/tests/output/metal-macro.07.html
  277. +0 −4 app/libs/Addons/PHPTAL/tests/output/metal-slot.01.html
  278. +0 −5 app/libs/Addons/PHPTAL/tests/output/metal-slot.02.html
  279. +0 −3  app/libs/Addons/PHPTAL/tests/output/metal-slot.03.html
  280. +0 −4 app/libs/Addons/PHPTAL/tests/output/metal-slot.04.html
  281. +0 −5 app/libs/Addons/PHPTAL/tests/output/namespaces.01.html
  282. +0 −11 app/libs/Addons/PHPTAL/tests/output/namespaces.02.html
  283. +0 −7 app/libs/Addons/PHPTAL/tests/output/namespaces.03.html
  284. +0 −27 app/libs/Addons/PHPTAL/tests/output/old-03.html
  285. +0 −12 app/libs/Addons/PHPTAL/tests/output/old-06.html
  286. +0 −11 app/libs/Addons/PHPTAL/tests/output/old-08.html
  287. +0 −4 app/libs/Addons/PHPTAL/tests/output/old-11.html
  288. +0 −8 app/libs/Addons/PHPTAL/tests/output/old-12.html
  289. +0 −36 app/libs/Addons/PHPTAL/tests/output/old-13.html
  290. +0 −12 app/libs/Addons/PHPTAL/tests/output/old-15.html
  291. +0 −41 app/libs/Addons/PHPTAL/tests/output/old-16.html
  292. +0 −4 app/libs/Addons/PHPTAL/tests/output/old-17.html
  293. +0 −7 app/libs/Addons/PHPTAL/tests/output/old-19.html
  294. +0 −4 app/libs/Addons/PHPTAL/tests/output/old-20.html
  295. +0 −18 app/libs/Addons/PHPTAL/tests/output/old-21.html
  296. +0 −4 app/libs/Addons/PHPTAL/tests/output/old-23.html
  297. +0 −8 app/libs/Addons/PHPTAL/tests/output/old-29.html
  298. +0 −5 app/libs/Addons/PHPTAL/tests/output/old-30.html
  299. +0 −1  app/libs/Addons/PHPTAL/tests/output/old-31.html
  300. +0 −23 app/libs/Addons/PHPTAL/tests/output/old-32.html
Sorry, we could not display the entire diff because too many files (375) changed.
View
63 app/libs/Addons/PHPTAL/tests/ArrayOverloadTest.php
@@ -1,63 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: ArrayOverloadTest.php 579 2009-04-25 23:14:46Z kornel $
- * @link http://phptal.org/
- */
-
-class MyArray implements ArrayAccess
-{
- public function push($value) {
- $this->_values[] = $value;
- }
-
- public function offsetGet($index){
- return $this->_values[$index];
- }
-
- public function offsetSet($index, $value){
- $this->_values[$index] = $value;
- }
-
- public function offsetExists($of){
- return isset($this->_values[$of]);
- }
-
- public function offsetUnset($of){
- unset($this->_values[$of]);
- }
-
- private $_values = array();
-}
-
-require_once dirname(__FILE__)."/config.php";
-
-class ArrayOverloadTest extends PHPTAL_TestCase
-{
- function testIt()
- {
- $arr = new MyArray();
- for ($i=0; $i<20; $i++){
- $val = new StdClass;
- $val->foo = "foo value $i";
- $arr->push($val);
- }
-
- $tpl = $this->newPHPTAL('input/array-overload.01.html');
- $tpl->myobject = $arr;
- $res = $tpl->execute();
- $exp = trim_file('output/array-overload.01.html');
- $res = trim_string($res);
- $this->assertEquals($exp, $res);
- }
-}
-
-
View
151 app/libs/Addons/PHPTAL/tests/AttributesInterpolationTest.php
@@ -1,151 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: AttributesInterpolationTest.php 579 2009-04-25 23:14:46Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class AttributesInterpolationTest extends PHPTAL_TestCase
-{
- public function testInterpol()
- {
- $src = <<<EOT
-<span title="\${foo}"></span>
-EOT;
- $exp = <<<EOT
-<span title="foo value"></span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testInterpol2()
- {
- $src = <<<EOT
-<span title="\${foo2} x \${structure foo} y \${foo}\${structure foo2}"></span><img/>
-EOT;
- $exp = <<<EOT
-<span title="{foo2 &lt;img /&gt;} x foo value y foo value{foo2 <img />}"></span><img/>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $tpl->foo2 = '{foo2 <img />}';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testInterpol3()
- {
- $src = <<<EOT
-<span title="\${foo}\${foo}1"></span>
-<span tal:attributes="title string:\${foo}\${foo}2"></span>
-<span tal:attributes="title '\${foo}\${foo}3'"></span>
-EOT;
- $exp = <<<EOT
-<span title="foo valuefoo value1"></span>
-<span title="foo valuefoo value2"></span>
-<span title="foo valuefoo value3"></span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testInterpol3a()
- {
- $src = <<<EOT
-<span tal:attributes="title php:'\${foo}\${foo}'"></span>
-<span title="<?php echo '\${foo}\${foo}' ?>"></span>
-EOT;
- $exp = <<<EOT
-<span title="\${foo}\${foo}"></span>
-<span title="\${foo}\${foo}"></span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testNoInterpol()
- {
- $src = <<<EOT
-<span title="$\${foo}"></span>
-EOT;
- $exp = <<<EOT
-<span title="\${foo}"></span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testNoInterpolAdv()
- {
- $src = <<<EOT
-<span title="$$\${foo}"></span>
-EOT;
- $exp = <<<EOT
-<span title="$\${foo}"></span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
-
- public function testPHPBlock()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p test=\'te&amp;st<?php echo "<x>"; ?>test<?php print("&amp;") ?>test\'/>');
- $this->assertEquals('<p test="te&amp;st<x>test&amp;test"></p>', $tpl->execute());
-}
-
- public function testPHPBlockShort()
- {
- ini_set('short_open_tag',1);
- if (!ini_get('short_open_tag')) $this->markTestSkipped("PHP is buggy");
-
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p test=\'te&amp;st<? print("<x>"); ?>test<?= "&amp;" ?>test\'/>');
- $this->assertEquals('<p test="te&amp;st<x>test&amp;test"></p>', $tpl->execute());
- ini_restore('short_open_tag');
- }
-
- public function testPHPBlockNoShort()
- {
- ini_set('short_open_tag', 0);
- if (ini_get('short_open_tag')) $this->markTestSkipped("PHP is buggy");
-
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p test=\'te&amp;st<? print("<x>"); ?>test<?= "&amp;" ?>test\'/>');
- try
- {
- $this->assertEquals(trim_string('<p test="te&amp;st&lt;? print("&lt;x&gt;"); ?&gt;test&lt;?= "&amp;" ?&gt;test"></p>'), trim_string($tpl->execute()));
- }
- catch(PHPTAL_ParserException $e) {/* xml ill-formedness error is ok too */}
- ini_restore('short_open_tag');
- }
-}
-
View
56 app/libs/Addons/PHPTAL/tests/BlockTest.php
@@ -1,56 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: BlockTest.php 579 2009-04-25 23:14:46Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class BlockTest extends PHPTAL_TestCase
-{
- function testTalBlock(){
- $t = $this->newPHPTAL();
- $t->setSource('<tal:block content="string:content"></tal:block>');
- $res = $t->execute();
- $this->assertEquals('content', $res);
- }
-
- function testMetalBlock(){
- $t = $this->newPHPTAL();
- $t->setSource('<metal:block>foo</metal:block>');
- $res = $t->execute();
- $this->assertEquals('foo', $res);
- }
-
- function testSomeNamespaceBlock()
- {
- $t = $this->newPHPTAL();
- $t->setSource('<foo:block xmlns:foo="http://phptal.example.com">foo</foo:block>');
- $res = $t->execute();
- $this->assertEquals('<foo:block xmlns:foo="http://phptal.example.com">foo</foo:block>', $res);
- }
-
- /**
- * @expectedException PHPTAL_ParserException
- */
- function testInvalidNamespaceBlock()
- {
- $t = $this->newPHPTAL();
-
- $this->setExpectedException('PHPTAL_Exception');
-
- $t->setSource('<foo:block>foo</foo:block>');
- $res = $t->execute();
- }
-}
-
-
View
158 app/libs/Addons/PHPTAL/tests/CodeCacheTest.php
@@ -1,158 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: CodeCacheTest.php 605 2009-05-03 02:50:26Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class PHPTAL_CodeCacheTest extends PHPTAL
-{
- public $testHasParsed = false;
- function parse()
- {
- $this->testHasParsed = true;
- return parent::parse();
- }
-}
-
-class CodeCacheTest extends PHPTAL_TestCase
-{
- private $phptal;
- private $codeDestination;
-
- private function resetPHPTAL()
- {
- $this->phptal = new PHPTAL_CodeCacheTest();
- $this->phptal->setForceReparse(false);
- $this->assertFalse($this->phptal->getForceReparse());
-
- if (function_exists('sys_get_temp_dir')) {
- $tmpdirpath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'temp_output';
- if (!is_dir($tmpdirpath)) mkdir($tmpdirpath);
- }
- else $this->markTestSkipped("Newer PHP needed");
-
- $this->assertTrue(is_dir($tmpdirpath));
- $this->assertTrue(is_writable($tmpdirpath));
-
- $this->phptal->setPhpCodeDestination($tmpdirpath);
- $this->codeDestination = $this->phptal->getPhpCodeDestination();
- }
-
- private function clearCache()
- {
- $this->assertContains(DIRECTORY_SEPARATOR.'temp_output'.DIRECTORY_SEPARATOR,$this->codeDestination);
- foreach (glob($this->codeDestination.'tpl_*') as $tpl) {
- $this->assertTrue(unlink($tpl), "Delete $tpl");
- }
- }
-
- function setUp()
- {
- parent::setUp();
- $this->resetPHPTAL();
- $this->clearCache();
- }
-
- function tearDown()
- {
- $this->clearCache();
- }
-
- function testNoParseOnReexecution()
- {
- $this->phptal->setSource('<p>hello</p>');
- $this->phptal->execute();
-
- $this->assertTrue($this->phptal->testHasParsed, "Initial parse");
-
- $this->phptal->testHasParsed = false;
- $this->phptal->execute();
-
- $this->assertFalse($this->phptal->testHasParsed, "No reparse");
- }
-
- function testNoParseOnReset()
- {
- $this->phptal->setSource('<p>hello2</p>');
- $this->phptal->execute();
-
- $this->assertTrue($this->phptal->testHasParsed, "Initial parse");
-
- $this->resetPHPTAL();
-
- $this->phptal->setSource('<p>hello2</p>');
- $this->phptal->execute();
-
- $this->assertFalse($this->phptal->testHasParsed, "No reparse");
- }
-
- function testReparseAfterTouch()
- {
- if (!is_writable('input/code-cache-01.html')) $this->markTestSkipped();
-
- $time1 = filemtime('input/code-cache-01.html');
- touch('input/code-cache-01.html', time());
- clearstatcache();
- $time2 = filemtime('input/code-cache-01.html');
- $this->assertNotEquals($time1,$time2,"touch() must work");
-
-
- $this->phptal->setTemplate('input/code-cache-01.html');
- $this->phptal->execute();
- $this->assertTrue($this->phptal->testHasParsed, "Initial parse");
-
- $this->resetPHPTAL();
-
- touch('input/code-cache-01.html', $time1);
- clearstatcache();
-
- $this->phptal->setTemplate('input/code-cache-01.html');
- $this->phptal->execute();
-
- $this->assertTrue($this->phptal->testHasParsed, "Reparse");
- }
-
- function testGarbageRemoval()
- {
- $src = '<test uniq="'.time().mt_rand().'" phptal:cache="1d" />';
- $this->phptal->setSource($src);
- $this->phptal->execute();
-
- $this->assertTrue($this->phptal->testHasParsed, "Parse");
-
- $this->phptal->testHasParsed = false;
- $this->phptal->setSource($src);
- $this->phptal->execute();
-
- $this->assertFalse($this->phptal->testHasParsed, "Reparse!?");
-
- $files = glob($this->codeDestination.'*');
- $this->assertEquals(2,count($files)); // one for template, one for cache
- foreach($files as $file) {
- $this->assertFileExists($file);
- touch($file, time() - 3600*24*100);
- }
- clearstatcache();
-
- $this->phptal->cleanUpGarbage(); // should delete all files
-
- clearstatcache();
-
- // can't check for reparse, because PHPTAL uses function_exists() as a shortcut!
- foreach($files as $file) {
- $this->assertFileNotExists($file);
- }
-
- }
-}
View
55 app/libs/Addons/PHPTAL/tests/CommentFilterTest.php
@@ -1,55 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: CommentFilterTest.php 760 2009-10-25 00:17:59Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-PHPTAL::setIncludePath();
-require_once 'PHPTAL/PreFilter.php';
-require_once 'PHPTAL/PreFilter/StripComments.php';
-PHPTAL::restoreIncludePath();
-
-class CommentFilterTest extends PHPTAL_TestCase
-{
- function testStripComments() {
- $t = $this->newPHPTAL('input/comment-filter-01.html');
- $t->addPreFilter(new PHPTAL_PreFilter_StripComments());
- $res = $t->execute();
- $res = trim_string($res);
- $exp = trim_file('output/comment-filter-01.html');
- $this->assertEquals($exp,$res);
- }
-
- function testPreservesScript() {
- $t = $this->newPHPTAL();
- $t->addPreFilter(new PHPTAL_PreFilter_StripComments());
- $t->setSource('<script>//<!--
- alert("1990s called"); /* && */
- //--></script>');
-
- $this->assertEquals(trim_string('<script>//<![CDATA[
- alert("1990s called"); /* && */
- //]]></script>'),trim_string($t->execute()));
- }
-
- function testNamespaceAware() {
- $t = $this->newPHPTAL();
- $t->addPreFilter(new PHPTAL_PreFilter_StripComments());
- $t->setSource('<script xmlns="http://example.com/foo">//<!--
- alert("1990s called"); /* && */
- //--></script>');
-
- $this->assertEquals(trim_string('<script xmlns="http://example.com/foo">//</script>'),trim_string($t->execute()));
- }
-}
View
94 app/libs/Addons/PHPTAL/tests/CommentTest.php
@@ -1,94 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: CommentTest.php 750 2009-10-24 22:03:17Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class CommentTest extends PHPTAL_TestCase
-{
- function testSimple()
- {
- $source = '<html><!-- \${variable} --></html>';
- $tpl = $this->newPHPTAL();
- $tpl->setSource($source);
- $res = $tpl->execute();
- $this->assertEquals($source, $res);
- }
-
- function testNoEntities()
- {
- $source = '<html><!-- <foo> --></html>';
- $tpl = $this->newPHPTAL();
- $tpl->setSource($source, __FILE__);
- $res = $tpl->execute();
- $this->assertEquals($source, $res);
- }
-
- function testShortComments()
- {
- $source = '<html><!--><--></html>';
- $tpl = $this->newPHPTAL();
- $tpl->setSource($source);
- $res = $tpl->execute();
- $this->assertEquals($source, $res);
- }
-
- /**
- * @expectedException PHPTAL_ParserException
- */
- function testNestedComments()
- {
- $source = '<html><!--<!--<!--></html>';
- $tpl = $this->newPHPTAL();
- $tpl->setSource($source);
- $res = $tpl->execute();
- $this->fail("Ill-formed comment accepted");
- }
-
- /**
- * @expectedException PHPTAL_ParserException
- */
- function testDashedComment()
- {
- $source = '<html><!--- XML hates you ---></html>';
- $tpl = $this->newPHPTAL();
- $tpl->setSource($source);
- $res = $tpl->execute();
- $this->fail("Ill-formed comment accepted");
- }
-
-
- function testSkippedComments()
- {
- $source = '<html><!--!
- removed --><!-- left --><!-- !removed --></html>';
- $tpl = $this->newPHPTAL();
- $tpl->setSource($source);
- $res = $tpl->execute();
- $this->assertEquals('<html><!-- left --></html>', $res);
- }
-
- function testCStyleComments()
- {
- $tpl = $this->newPHPTAL();
- $src = '<script><!--
- // comment
- /* comment <tag> */
- // comment
- --></script>';
- $tpl->setSource($src);
- $this->assertEquals($src,$tpl->execute());
- }
-}
-
View
37 app/libs/Addons/PHPTAL/tests/ContentEncodingTest.php
@@ -1,37 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: ContentEncodingTest.php 579 2009-04-25 23:14:46Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class ContentEncodingTest extends PHPTAL_TestCase
-{
- function testSimple()
- {
- $tpl = $this->newPHPTAL('input/content-encoding.xml');
- $res = $tpl->execute();
- $exp = trim_file('output/content-encoding.xml');
- $res = trim_string($res);
- $this->assertEquals($exp, $res);
- }
-
- function testEchoArray()
- {
- $p = $this->newPHPTAL();
- $p->setSource('<p tal:content="foo"/>');
- $p->foo = array('bar'=>'a&aa','<bbb>',null,-1);
- $this->assertEquals('<p>a&amp;aa, &lt;bbb&gt;, , -1</p>',$p->execute());
- }
-}
-
View
164 app/libs/Addons/PHPTAL/tests/ContentInterpolationTest.php
@@ -1,164 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: ContentInterpolationTest.php 579 2009-04-25 23:14:46Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class ContentInterpolationTest extends PHPTAL_TestCase
-{
- public function testInterpol()
- {
- $src = <<<EOT
-<span>\${foo}</span>
-EOT;
- $exp = <<<EOT
-<span>foo value</span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testInterpol2()
- {
- $src = <<<EOT
-<span>\${foo2} x \${structure foo} y \${foo}\${structure foo2}</span><img/>
-EOT;
- $exp = <<<EOT
-<span>{foo2 &lt;img /&gt;} x foo value y foo value{foo2 <img />}</span><img/>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $tpl->foo2 = '{foo2 <img />}';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testInterpol3()
- {
- $src = <<<EOT
-<span>\${foo}\${foo}</span>
-EOT;
- $exp = <<<EOT
-<span>foo valuefoo value</span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testNoInterpol()
- {
- $src = <<<EOT
-<span>$\${foo}</span>
-EOT;
- $exp = <<<EOT
-<span>\${foo}</span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testNoInterpolAdv()
- {
- $src = <<<EOT
-<span>$$\${foo}</span>
-EOT;
- $exp = <<<EOT
-<span>$\${foo}</span>
-EOT;
- $tpl = $this->newPHPTAL();
- $tpl->setSource($src);
- $tpl->foo = 'foo value';
- $res = $tpl->execute();
- $this->assertEquals($exp, $res);
- }
-
- public function testPHPBlock()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>test<?php echo "<x>"; ?>test<?php print("&amp;") ?>test</p>');
- $this->assertEquals('<p>test<x>test&amp;test</p>', $tpl->execute());
-}
-
- public function testPHPBlockShort()
- {
- ini_set('short_open_tag',1);
- if (!ini_get('short_open_tag')) $this->markTestSkipped("PHP is buggy");
-
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>test<? print("<x>"); ?>test<?= "&amp;" ?>test</p>');
- $this->assertEquals('<p>test<x>test&amp;test</p>', $tpl->execute());
- ini_restore('short_open_tag');
- }
-
- public function testPHPBlockNoShort()
- {
- ini_set('short_open_tag', 0);
- if (ini_get('short_open_tag')) $this->markTestSkipped("PHP is buggy");
-
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>test<? print("<x>"); ?>test<?= "&amp;" ?>test</p>');
- try
- {
- // unlike attributes, this isn't going to be escaped, because it gets parsed as a real processing instruction
- $this->assertEquals('<p>test<? print("<x>"); ?>test<?= "&amp;" ?>test</p>', $tpl->execute());
- }
- catch(PHPTAL_ParserException $e) {/* xml ill-formedness error is ok too */}
- ini_restore('short_open_tag');
- }
-
- /**
- * @expectedException PHPTAL_VariableNotFoundException
- */
- function testErrorsThrow()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>${error}</p>');
- $tpl->execute();
- }
-
- /**
- * @expectedException PHPTAL_VariableNotFoundException
- */
- function testErrorsThrow2()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>${error | error}</p>');
- $tpl->execute();
- }
-
- function testErrorsSilenced()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>${error | nothing}</p>');
- $this->assertEquals('<p></p>',$tpl->execute());
- }
-
- function testZeroIsNotEmpty()
- {
- $tpl = $this->newPHPTAL();
- $tpl->zero = '0';
- $tpl->setSource('<p>${zero | error}</p>');
- $this->assertEquals('<p>0</p>',$tpl->execute());
- }
-}
View
84 app/libs/Addons/PHPTAL/tests/DoctypeTest.php
@@ -1,84 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: DoctypeTest.php 707 2009-09-02 10:15:41Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class DoctypeTest extends PHPTAL_TestCase
-{
- function testSimple()
- {
- $tpl = $this->newPHPTAL('input/doctype.01.html');
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_file('output/doctype.01.html');
- $this->assertEquals($exp, $res);
- }
-
- function testMacro()
- {
- $tpl = $this->newPHPTAL('input/doctype.02.user.html');
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_file('output/doctype.02.html');
- $this->assertEquals($exp, $res);
- }
-
- function testDeepMacro()
- {
- $tpl = $this->newPHPTAL('input/doctype.03.html');
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_file('output/doctype.03.html');
- $this->assertEquals($exp, $res);
- }
-
- function testDtdInline()
- {
- $tpl = $this->newPHPTAL('input/doctype.04.html');
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_file('output/doctype.04.html');
- $this->assertEquals($exp, $res);
- }
-
- function testClearedOnReexecution()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><whatever/>');
-
- $this->assertContains("DOCTYPE html PUBLIC",$tpl->execute());
- $this->assertContains("DOCTYPE html PUBLIC",$tpl->execute());
-
- $tpl->setSource('<whatever/>');
-
- $this->assertNotContains("DOCTYPE html PUBLIC",$tpl->execute());
- $this->assertNotContains("DOCTYPE html PUBLIC",$tpl->execute());
- }
-
- /**
- * this is pretty crazy case of PHPTAL being reused while template is still being executed
- */
- function testClearedOnNestedReexecution()
- {
- $tpl = $this->newPHPTAL();
- $tpl->tpl = $tpl;
-
- $tpl->setSource('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <hack tal:define="hack php:tpl.setSource(&quot;&lt;hacked/&gt;&quot;)" tal:content="structure hack/execute"/>');
-
- $this->assertEquals(trim_string('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><hack><hacked></hacked></hack>'),
- trim_string($tpl->execute()));
- }
-}
View
129 app/libs/Addons/PHPTAL/tests/DomTest.php
@@ -1,129 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-PHPTAL::setIncludePath();
-require_once 'PHPTAL/Dom/DocumentBuilder.php';
-PHPTAL::restoreIncludePath();
-
-class DOMTest extends PHPTAL_TestCase
-{
- private function newElement($name = 'foo',$ns = '')
- {
- $xmlns = new PHPTAL_Dom_XmlnsState(array(),'');
- return new PHPTAL_Dom_Element($name,$ns,array(),$xmlns);
- }
-
- function testAppendChild()
- {
- $el1 = $this->newElement();
- $el2 = $this->newElement();
-
- $this->assertType('array',$el1->childNodes);
- $this->assertNull($el2->parentNode);
-
- $el1->appendChild($el2);
- $this->assertNull($el1->parentNode);
- $this->assertSame($el1,$el2->parentNode);
- $this->assertEquals(1,count($el1->childNodes));
- $this->assertTrue(isset($el1->childNodes[0]));
- $this->assertSame($el2,$el1->childNodes[0]);
- }
-
- function testAppendChildChangesParent()
- {
- $el1 = $this->newElement();
- $el2 = $this->newElement();
-
- $ch = $this->newElement();
-
- $el1->appendChild($ch);
-
- $this->assertTrue(isset($el1->childNodes[0]));
- $this->assertSame($ch,$el1->childNodes[0]);
-
- $el2->appendChild($ch);
-
- $this->assertTrue(isset($el2->childNodes[0]));
- $this->assertSame($ch,$el2->childNodes[0]);
-
- $this->assertFalse(isset($el1->childNodes[0]));
-
- $this->assertEquals(0,count($el1->childNodes));
- $this->assertEquals(1,count($el2->childNodes));
- }
-
- function testRemoveChild()
- {
- $el1 = $this->newElement();
- $el2 = $this->newElement();
- $el3 = $this->newElement();
- $el4 = $this->newElement();
-
- $el1->appendChild($el2);
- $el1->appendChild($el3);
- $el1->appendChild($el4);
-
- $this->assertEquals(3,count($el1->childNodes));
- $this->assertTrue(isset($el1->childNodes[2]));
- $this->assertFalse(isset($el1->childNodes[3]));
-
- $this->assertSame($el1,$el4->parentNode);
-
- $el1->removeChild($el4);
-
- $this->assertNull($el4->parentNode);
-
- $this->assertEquals(2,count($el1->childNodes));
- $this->assertTrue(isset($el1->childNodes[1]));
- $this->assertFalse(isset($el1->childNodes[2]));
- $this->assertSame($el3,end($el1->childNodes));
-
- $el1->removeChild($el2);
-
- $this->assertEquals(1,count($el1->childNodes));
- $this->assertTrue(isset($el1->childNodes[0]));
- $this->assertFalse(isset($el1->childNodes[1]));
-
- }
-
- function testReplaceChild()
- {
- $el1 = $this->newElement();
- $el2 = $this->newElement();
- $el3 = $this->newElement();
- $el4 = $this->newElement();
-
- $r = $this->newElement();
-
- $el1->appendChild($el2);
- $el1->appendChild($el3);
- $el1->appendChild($el4);
-
- $this->assertEquals(3,count($el1->childNodes));
- $this->assertSame($el3,$el1->childNodes[1]);
-
- $el1->replaceChild($r, $el3);
-
- $this->assertEquals(3,count($el1->childNodes));
- $this->assertSame($el2,$el1->childNodes[0]);
- $this->assertSame($r,$el1->childNodes[1]);
- $this->assertSame($el4,$el1->childNodes[2]);
-
- $this->assertNull($el3->parentNode);
- $this->assertSame($el1,$r->parentNode);
- }
-}
View
73 app/libs/Addons/PHPTAL/tests/EchoExecuteTest.php
@@ -1,73 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: EchoExecuteTest.php 584 2009-04-27 11:45:25Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class EchoExecuteTest extends PHPTAL_TestCase
-{
- private function echoExecute(PHPTAL $tpl)
- {
- try {
- ob_start();
- $this->assertEquals(0,strlen($tpl->echoExecute()));
- $res = ob_get_clean();
- }
- catch(Exception $e) {
- ob_end_clean();
- throw $e;
- }
-
- $res2 = $tpl->execute();
- $res3 = $tpl->execute();
-
- $this->assertEquals($res2,$res3,"Multiple runs should give same result");
-
- $this->assertEquals($res2,$res,"Execution with and without buffering should give same result");
-
- return trim_string($res);
- }
-
- function testEchoExecute()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<hello/>');
-
- $this->assertEquals("<hello></hello>",$this->echoExecute($tpl));
- }
-
- function testEchoExecuteDecls()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><hello/>');
-
- $this->assertEquals(trim_string('<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><hello></hello>'),$this->echoExecute($tpl));
- }
-
- function testEchoExecuteDeclsMacro()
- {
- try
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><hello><m metal:define-macro="test">test</m><x metal:use-macro="test"/></hello>');
-
- $this->assertEquals(trim_string('<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><hello><m>test</m></hello>'),$this->echoExecute($tpl));
- }
- catch(PHPTAL_ConfigurationException $e)
- {
- // this is fine. Combination of macros and echoExecute is not supported yet (if it were, the test above is valid)
- $this->assertContains("echoExecute",$e->getMessage());
- }
- }
-}
View
165 app/libs/Addons/PHPTAL/tests/EscapeCDATATest.php
@@ -1,165 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: EscapeCDATATest.php 579 2009-04-25 23:14:46Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class EscapeCDATATest extends PHPTAL_TestCase {
-
- private function executeString($str, $params = array())
- {
- $tpl = $this->newPHPTAL();
- foreach ($params as $k => $v) $tpl->set($k,$v);
- $tpl->setSource($str);
- return $tpl->execute();
- }
-
- function testTrimString()
- {
- $this->assertEquals(
- trim_string('<foo><bar>]]&gt; foo ]> bar</bar></foo>'),
- trim_string('<foo> <bar>]]&gt; foo ]&gt; bar </bar> </foo>')
- );
-
- $this->assertNotEquals(
- trim_string('foo]]>bar'),
- trim_string('foo]]&gt;bar')
- );
-
- }
-
- function testDoesEscapeHTMLContent(){
- $tpl = $this->newPHPTAL('input/escape.html');
- $exp = trim_file('output/escape.html');
- $res = trim_string($tpl->execute());
- $this->assertEquals($exp, $res);
- }
-
- function testEntityTextInPath()
- {
- $res = $this->executeString('<div><![CDATA[${text \'"< & &amp; &quot; &lt;\'},${false | string:"< & &amp; &quot; &lt;}]]></div>');
-
- // either way is good
- if (false !== strpos($res,'<![CDATA[')) {
- $this->assertEquals('<div><![CDATA["< & &amp; &quot; &lt;,"< & &amp; &quot; &lt;]]></div>', $res);
- } else {
- $this->assertEquals('<div>&quot;&lt; &amp; &amp;amp; &amp;quot; &amp;lt;,&quot;&lt; &amp; &amp;amp; &amp;quot; &amp;lt;</div>', $res);
- }
- }
-
- function testEntityStructureInPath()
- {
- $res = $this->executeString('<div><![CDATA[${structure \'"< & &amp; &quot; &lt;\'},${structure false | string:"< & &amp; &quot; &lt;}]]></div>');
- $this->assertEquals('<div><![CDATA["< & &amp; &quot; &lt;,"< & &amp; &quot; &lt;]]></div>', $res);
- }
-
- function testEntityInContentPHP()
- {
- $res = $this->executeString('<div><![CDATA[${php:strlen(\'&quot;&amp;&lt;\')},${php:strlen(\'<"&\')}]]></div>');
- $this->assertEquals('<div>15,3</div>',$res);
- }
-
- function testEntityInScriptPHP()
- {
- $res = $this->executeString('<script><![CDATA[${php:strlen(\'&quot;&amp;&lt;\')},${php:strlen(\'<"&\')}]]></script>');
- $this->assertEquals('<script><![CDATA[15,3]]></script>',$res);
- }
-
- function testEntityInPHP2()
- {
- $res = $this->executeString('<div><![CDATA[${structure php:strlen(\'&quot;&amp;&lt;\')},${structure php:strlen(\'<"&\')}]]></div>');
- $this->assertEquals('<div><![CDATA[15,3]]></div>',$res);
- }
-
- function testEntityInPHP3()
- {
- $res = $this->executeString('<div><![CDATA[<?php echo strlen(\'&quot;&amp;&lt;\')?>,<?php echo strlen(\'<"&\') ?>]]></div>');
- $this->assertEquals('<div><![CDATA[15,3]]></div>',$res);
- }
-
- function testNoEncodingAfterPHP()
- {
- $res = $this->executeString('<div><![CDATA[${php:urldecode(\'%26%22%3C\')},${structure php:urldecode(\'%26%22%3C\')},<?php echo urldecode(\'%26%22%3C\') ?>]]></div>');
- $this->assertEquals('<div><![CDATA[&"<,&"<,&"<]]></div>',$res);
- }
-
- /**
- * normal XML behavior expected
- */
- function testEscapeCDATAXML()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setOutputMode(PHPTAL::XML);
- $tpl->setSource('<y><![CDATA[${cdata}; ${php:cdata};]]></y> <y><![CDATA[${structure cdata}]]></y>');
- $tpl->cdata = ']]></x>';
- $res = $tpl->execute();
- $this->assertEquals('<y>]]&gt;&lt;/x&gt;; ]]&gt;&lt;/x&gt;;</y> <y><![CDATA[]]></x>]]></y>',$res);
- }
-
- /**
- * ugly hybrid between HTML (XHTML as text/html) and XML
- */
- function testEscapeCDATAXHTML()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setOutputMode(PHPTAL::XHTML);
- $tpl->setSource('<script><![CDATA[${cdata}; ${php:cdata};]]></script> <y><![CDATA[${structure cdata}]]></y>');
- $tpl->cdata = ']]></x>';
- $res = $tpl->execute();
- $this->assertEquals('<script><![CDATA[]]]]><![CDATA[><\/x>; ]]]]><![CDATA[><\/x>;]]></script> <y><![CDATA[]]></x>]]></y>',$res);
- }
-
-
- function testEscapeCDATAHTML()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setOutputMode(PHPTAL::HTML5);
- $tpl->setSource('<y><![CDATA[${cdata}; ${php:cdata};]]></y> <y><![CDATA[${structure cdata}]]></y>');
- $tpl->cdata = ']]></x>';
- $res = $tpl->execute();
- $this->assertEquals('<y>]]&gt;&lt;/x&gt;; ]]&gt;&lt;/x&gt;;</y> <y>]]></x></y>',$res);
- }
-
-
-
- function testAutoCDATA()
- {
- $res = $this->executeString('<script> 1 < 2 </script>');
- $this->assertEquals('<script>/*<![CDATA[*/ 1 < 2 /*]]>*/</script>',$res);
- }
-
- function testAutoCDATA2()
- {
- $res = $this->executeString('<xhtmlz:script xmlns:xhtmlz="http://www.w3.org/1999/xhtml"> 1 < 2 ${php:\'&\' . \'&amp;\'} </xhtmlz:script>');
- $this->assertEquals('<xhtmlz:script xmlns:xhtmlz="http://www.w3.org/1999/xhtml">/*<![CDATA[*/ 1 < 2 && /*]]>*/</xhtmlz:script>',$res);
- }
-
- function testNoAutoCDATA()
- {
- $res = $this->executeString('<script> "1 \' 2" </script><script xmlns="foo"> 1 &lt; 2 </script>');
- $this->assertEquals('<script> "1 \' 2" </script><script xmlns="foo"> 1 &lt; 2 </script>',$res);
- }
-
- function testNoAutoCDATA2()
- {
- $res = $this->executeString('<script> a && ${structure foo} </script><script xmlns="foo"> 1 &lt; 2 </script>', array('foo'=>'<foo/>'));
- $this->assertEquals('<script> a &amp;&amp; <foo/> </script><script xmlns="foo"> 1 &lt; 2 </script>',$res);
- }
-
- function testNoAutoCDATA3()
- {
- $res = $this->executeString('<style> html > body </style>');
- $this->assertEquals('<style> html > body </style>',$res);
- }
-}
View
201 app/libs/Addons/PHPTAL/tests/EscapeHTMLTest.php
@@ -1,201 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: EscapeHTMLTest.php 618 2009-05-24 22:26:06Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class EscapeHTMLTest extends PHPTAL_TestCase {
-
- private function executeString($str, $params = array())
- {
- $tpl = $this->newPHPTAL();
- foreach ($params as $k => $v) $tpl->set($k,$v);
- $tpl->setSource($str);
- return $tpl->execute();
- }
-
- function testDoesEscapeHTMLContent(){
- $tpl = $this->newPHPTAL('input/escape.html');
- $exp = trim_file('output/escape.html');
- $res = trim_string($tpl->execute());
- $this->assertEquals($exp, $res);
- }
-
- function testEntityDecodingPath1()
- {
- $res = $this->executeString('<div title="&quot;" class=\'&quot;\' tal:content="\'&quot; quote character\'" />');
- $this->assertNotContains('&amp;',$res);
- }
-
- function testEntityDecodingBeforePHP()
- {
- /* PHP block in attributes gets raw input (that's not XML style, but PHP style) */
- $res = $this->executeString('<div title="${php:strlen(\'&quot;&amp;\')}" class="<?php echo strlen(\'&quot;&amp;\')?>">'.
- '<tal:block tal:content="php:strlen(\'&quot;&amp;\')" />,${php:strlen(\'&quot;&amp;\')}</div>');
- $this->assertEquals('<div title="2" class="11">2,2</div>',$res);
- }
-
- function testEntityEncodingAfterPHP()
- {
- $res = $this->executeString('<div title="${php:urldecode(\'%26%22%3C\')}"><tal:block tal:content="php:urldecode(\'%26%22%3C\')" />,${php:urldecode(\'%26%22%3C\')}</div>');
- $this->assertEquals('<div title="&amp;&quot;&lt;">&amp;&quot;&lt;,&amp;&quot;&lt;</div>',$res);
- }
-
- function testNoEntityEncodingAfterStructurePHP()
- {
- $res = $this->executeString('<div title="${structure php:urldecode(\'%26%20%3E%27\')}" class="<?php echo urldecode(\'%26%20%3E%27\')?>">'.
- '<tal:block tal:content="structure php:urldecode(\'%26%20%3E%22\')" />,${structure php:urldecode(\'%26%20%3E%22\')},<?php echo urldecode(\'%26%20%3E%22\')?></div>');
- $this->assertEquals('<div title="& >\'" class="& >\'">& >",& >",& >"</div>',$res);
- }
-
- function testDecodingBeforeStructure()
- {
- $res = $this->executeString('<div tal:content="structure php:\'&amp; quote character\'" />');
- $this->assertNotContains('&amp;',$res);
- }
-
- function testEntityDecodingPHP1()
- {
- $res = $this->executeString('<div tal:content="php:\'&quot; quote character\'" />');
- $this->assertNotContains('&amp;',$res);
- }
-
- function testEntityDecodingPath2()
- {
- $res = $this->executeString('<div tal:attributes="title \'&quot; quote character\'" />');
- $this->assertNotContains('&amp;',$res);
- }
-
- function testEntityDecodingPHP2()
- {
- $res = $this->executeString('<div tal:attributes="title php:\'&quot; quote character\'" />');
- $this->assertNotContains('&amp;',$res);
- }
-
- function testEntityDecodingPath3()
- {
- $res = $this->executeString('<p>${\'&quot; quote character\'}</p>');
- $this->assertNotContains('&amp;',$res);
- }
-
- function testEntityDecodingPHP3()
- {
- $res = $this->executeString('<p>${php:\'&quot; quote character\'}</p>');
- $this->assertNotContains('&amp;',$res);
- }
-
-
- function testEntityEncodingPath1()
- {
- $res = $this->executeString('<div tal:content="\'&amp; ampersand character\'" />');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingPHP1()
- {
- $res = $this->executeString('<div tal:content="php:\'&amp; ampersand character\'" />');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingPath2()
- {
- $res = $this->executeString('<div tal:attributes="title \'&amp; ampersand character\'" />');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingVariables()
- {
- $res = $this->executeString('<div tal:attributes="title variable; class variable">${variable}${php:variable}</div>',
- array('variable'=>'& = ampersand, " = quote, \' = apostrophe'));
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingAttributesDefault1()
- {
- $res = $this->executeString('<div tal:attributes="title idontexist | default" title=\'&amp; ampersand character\' />');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingAttributesDefault2()
- {
- $res = $this->executeString('<div tal:attributes="title idontexist | default" title=\'&quot;&apos;\' />');
- $this->assertNotContains('&amp;',$res);
- $this->assertContains('&quot;',$res); // or apos...
- }
-
- function testEntityEncodingPHP2()
- {
- $res = $this->executeString('<div tal:attributes="title php:\'&amp; ampersand character\'" />');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingPath3()
- {
- $res = $this->executeString('<p>${\'&amp; ampersand character\'}</p>');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testEntityEncodingPHP3()
- {
- $res = $this->executeString('<p>&{php:\'&amp; ampersand character\'}</p>');
- $this->assertContains('&amp;',$res);
- $this->assertNotContains('&amp;amp;',$res);
- $this->assertNotContains('&amp;&amp;',$res);
- }
-
- function testSimpleXML()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>${x} ${y}</p>');
- $simplexml = new SimpleXMLElement('<foo title="bar&amp;&lt;" empty="">foo&amp;&lt;</foo>');
-
- $tpl->x = $simplexml['title'];
- $tpl->y = $simplexml['empty'];
- $this->assertEquals('<p>bar&amp;&lt; </p>',$tpl->execute());
- }
-
- function testStructureSimpleXML()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setSource('<p>${structure x} ${structure y}</p>');
- $simplexml = new SimpleXMLElement('<foo title="bar&amp;&lt;" empty="">foo&amp;&lt;</foo>');
-
- $tpl->x = $simplexml['title'];
- $tpl->y = $simplexml['empty'];
- $this->assertEquals('<p>bar&< </p>',$tpl->execute());
- }
-
- function testUnicodeUnescaped()
- {
- $tpl = $this->newPHPTAL();
- $tpl->World = '${World}'; // a quine! ;)
- $tpl->setSource($src = '<p>Hello “${World}!”</p>');
-
- $this->assertEquals($src, $tpl->execute());
- }
-}
View
168 app/libs/Addons/PHPTAL/tests/GetTextTest.php
@@ -1,168 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: GetTextTest.php 596 2009-05-02 18:05:35Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-PHPTAL::setIncludePath();
-require_once 'PHPTAL/GetTextTranslator.php';
-PHPTAL::restoreIncludePath();
-
-class GetTextTest extends PHPTAL_TestCase
-{
- private function getTextTranslator()
- {
- try
- {
- return new PHPTAL_GetTextTranslator();
- }
- catch(PHPTAL_Exception $e)
- {
- $this->markTestSkipped($e->getMessage());
- }
- }
-
-
- function testSimple()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('en_GB', 'en_GB.utf8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.01.html');
- $tpl->setTranslator($gettext);
- $res = trim_string($tpl->execute());
- $exp = trim_file('output/gettext.01.html');
- $this->assertEquals($exp, $res);
- }
-
- function testLang()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('fr_FR', 'fr_FR@euro', 'fr_FR.utf8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.02.html');
- $tpl->setTranslator($gettext);
- $res = trim_string($tpl->execute());
- $exp = trim_file('output/gettext.02.html');
- $this->assertEquals($exp, $res);
- }
-
- function testInterpol()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('fr_FR', 'fr_FR@euro', 'fr_FR.utf8');
- $gettext->setEncoding('UTF-8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.03.html');
- $tpl->setTranslator($gettext);
- $tpl->login = 'john';
- $tpl->lastCxDate = '2004-12-25';
- $res = trim_string($tpl->execute());
- $exp = trim_file('output/gettext.03.html');
- $this->assertEquals($exp, $res);
- }
-
- function testDomainChange()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setEncoding('UTF-8');
- $gettext->setLanguage('fr_FR', 'fr_FR@euro', 'fr_FR.utf8');
- $gettext->addDomain('test');
- $gettext->addDomain('test2');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.04.html');
- $tpl->setEncoding('UTF-8');
- $tpl->setTranslator($gettext);
- $tpl->login = 'john';
- $tpl->lastCxDate = '2004-12-25';
- $res = trim_string($tpl->execute());
- $exp = trim_file('output/gettext.04.html');
- $this->assertEquals($exp, $res);
- }
-
- function testSpaces()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('en_GB', 'en_GB.utf8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.05.html');
- $tpl->login = 'john smith';
- $tpl->setTranslator($gettext);
- $res = trim_string($tpl->execute());
- $exp = trim_file('output/gettext.05.html');
- $this->assertEquals($exp, $res);
- }
-
- function testAccentuateKey()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('en_GB', 'en_GB.utf8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
- $gettext->setCanonicalize(true);
-
- $tpl = $this->newPHPTAL('input/gettext.06.html');
- $tpl->setTranslator($gettext);
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_file('output/gettext.06.html');
- $this->assertEquals($exp, $res);
- }
-
- function testAccentuateKeyNonCanonical()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('en_GB', 'en_GB.utf8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.06.html');
- $tpl->setTranslator($gettext);
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_string('<root>
- <span>Not accentuated</span>
- <span>Accentuated key without canonicalization</span>
- <span>Accentuated key without canonicalization</span>
-</root>
-');
- $this->assertEquals($exp, $res);
- }
-
- function testQuote()
- {
- $gettext = $this->getTextTranslator();
- $gettext->setLanguage('en_GB', 'en_GB.utf8');
- $gettext->addDomain('test');
- $gettext->useDomain('test');
-
- $tpl = $this->newPHPTAL('input/gettext.07.html');
- $tpl->setTranslator($gettext);
- $res = $tpl->execute();
- $res = trim_string($res);
- $exp = trim_file('output/gettext.07.html');
- $this->assertEquals($exp, $res);
- }
-}
-
-
View
170 app/libs/Addons/PHPTAL/tests/HTML5ModeTest.php
@@ -1,170 +0,0 @@
-<?php
-/**
- * PHPTAL templating engine
- *
- * PHP Version 5
- *
- * @category HTML
- * @package PHPTAL
- * @author Laurent Bedubourg <lbedubourg@motion-twin.com>
- * @author Kornel Lesiński <kornel@aardvarkmedia.co.uk>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
- * @version SVN: $Id: HTML5ModeTest.php 665 2009-07-10 23:11:17Z kornel $
- * @link http://phptal.org/
- */
-
-require_once dirname(__FILE__)."/config.php";
-
-class HTML5ModeTest extends PHPTAL_TestCase
-{
- function testCDATAScript()
- {
- $tpl = $this->newPHPTAL();
- $tpl->setOutputMode(PHPTAL::HTML5);
- $tpl->setSource('<!DOCTYPE html><script><![CDATA[
- if (2 < 5) {
- alert("</foo>");
- }
- ]]></script>');
-
- $this->assertEquals(trim_string('<!DOCTYPE html><script> if (2 < 5) { alert("<\/foo>"); } </script>'),trim_string($tpl->execute()));
- }