01-render.php 755 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace la_restaurant_theme;
  3. require_once("enviroment.php");
  4. $template = 'sample is <<! place !>> and <<!other!>> more';
  5. $first = 'sample is best and pink more';
  6. $second = 'sample is much and is more';
  7. $corrupted = 'sample is <<! <<! place !>> and <<!other!>> !>> more';
  8. $first_corrupted = 'sample is best and pink more';
  9. $first_result = renderer::from($template)
  10. ->set('place', 'best')
  11. ->set('other', 'pink')
  12. ->render();
  13. $second_result = renderer::from($template)
  14. ->set('place', 'much')
  15. ->set('other', 'is')
  16. ->render();
  17. $first_corrupted_result = renderer::from($template)
  18. ->set('place', 'best')
  19. ->set('other', 'pink')
  20. ->render();
  21. test($first, $first_result);
  22. test($second, $second_result);
  23. test($first_corrupted, $first_corrupted_result);