inlineHtml.test 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. Handling of inline HTML
  2. -----
  3. <?php
  4. function test() {
  5. ?>Foo<?php
  6. }
  7. -----
  8. $stmts[0]->setAttribute('origNode', null);
  9. -----
  10. <?php
  11. function test()
  12. {
  13. ?>Foo<?php
  14. }
  15. -----
  16. <?php
  17. function test() {
  18. foo();
  19. ?>Bar<?php
  20. baz();
  21. }
  22. -----
  23. // TODO Fix broken result
  24. $stmts[0]->stmts[2] = $stmts[0]->stmts[1];
  25. -----
  26. <?php
  27. function test() {
  28. foo();
  29. ?>Bar<?php
  30. Bar
  31. }
  32. -----
  33. <?php
  34. function test() {
  35. foo();
  36. ?>Bar<?php
  37. baz();
  38. }
  39. -----
  40. // TODO Preserve formatting
  41. $stmts[0]->stmts[1] = $stmts[0]->stmts[2];
  42. -----
  43. <?php
  44. function test()
  45. {
  46. foo();
  47. baz();
  48. baz();
  49. }
  50. -----
  51. <?php
  52. function test() {
  53. foo();
  54. ?>Bar<?php
  55. baz();
  56. }
  57. -----
  58. // TODO Preserve formatting
  59. unset($stmts[0]->stmts[2]);
  60. -----
  61. <?php
  62. function test()
  63. {
  64. foo();
  65. ?>Bar<?php
  66. }
  67. -----
  68. <?php
  69. function test() {
  70. foo();
  71. ?>Bar<?php
  72. baz();
  73. }
  74. -----
  75. // TODO Preserve formatting
  76. array_splice($stmts[0]->stmts, 0, 1, []);
  77. -----
  78. <?php
  79. function test()
  80. {
  81. ?>Bar<?php
  82. baz();
  83. }
  84. -----
  85. <?php
  86. function test() {
  87. foo();
  88. ?>Bar<?php
  89. baz();
  90. }
  91. -----
  92. // TODO Preserve formatting
  93. array_splice($stmts[0]->stmts, 1, 1, []);
  94. -----
  95. <?php
  96. function test()
  97. {
  98. foo();
  99. baz();
  100. }