EmailTemplateTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Tests for obsolete directives in email templates
  8. */
  9. namespace Magento\Test\Legacy;
  10. class EmailTemplateTest extends \PHPUnit\Framework\TestCase
  11. {
  12. public function testObsoleteDirectives()
  13. {
  14. $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
  15. $invoker(
  16. /**
  17. * @param string $file
  18. */
  19. function ($file) {
  20. $this->assertNotRegExp(
  21. '/\{\{htmlescape.*?\}\}/i',
  22. file_get_contents($file),
  23. 'Directive {{htmlescape}} is obsolete. Use {{var}} instead.'
  24. );
  25. $this->assertNotRegExp(
  26. '/\{\{escapehtml.*?\}\}/i',
  27. file_get_contents($file),
  28. 'Directive {{escapehtml}} is obsolete. Use {{var}} instead.'
  29. );
  30. },
  31. \Magento\Framework\App\Utility\Files::init()->getEmailTemplates()
  32. );
  33. }
  34. }