ClassyTemplatesIdenticalToStableTest.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace Drupal\Tests\Core\Theme;
  3. use Drupal\Tests\UnitTestCase;
  4. /**
  5. * Confirms that certain Classy templates have identical equivalents in Stable.
  6. *
  7. * @group Theme
  8. */
  9. class ClassyTemplatesIdenticalToStableTest extends UnitTestCase {
  10. /**
  11. * Confirms that certain Classy templates have equivalents in Stable.
  12. *
  13. * @dataProvider providerTestStableTemplatesIdenticalToClassy
  14. *
  15. * @param string $template
  16. * The template file to test.
  17. */
  18. public function testStableTemplatesIdenticalToClassy($template) {
  19. $stable_template = $this->root . '/core/themes/stable/templates' . $template;
  20. $classy_template = $this->root . '/core/themes/classy/templates' . $template;
  21. $this->assertFileExists($stable_template);
  22. $this->assertFileExists($classy_template);
  23. $this->assertSame(md5_file($stable_template), md5_file($classy_template), 'The templates should have the same checksums.');
  24. }
  25. /**
  26. * A list of the Classy templates that have identical copies in Stable.
  27. */
  28. public function providerTestStableTemplatesIdenticalToClassy() {
  29. return [
  30. ['/content-edit/file-upload-help.html.twig'],
  31. ['/content-edit/file-widget-multiple.html.twig'],
  32. ['/field/image-formatter.html.twig'],
  33. ['/field/image-style.html.twig'],
  34. ['/form/checkboxes.html.twig'],
  35. ['/form/confirm-form.html.twig'],
  36. ['/form/container.html.twig'],
  37. ['/form/dropbutton-wrapper.html.twig'],
  38. ['/form/field-multiple-value-form.html.twig'],
  39. ['/form/form.html.twig'],
  40. ['/form/form-element-label.html.twig'],
  41. ['/form/input.html.twig'],
  42. ['/form/select.html.twig'],
  43. ['/navigation/links.html.twig'],
  44. ['/navigation/menu-local-action.html.twig'],
  45. ['/navigation/pager.html.twig'],
  46. ['/navigation/vertical-tabs.html.twig'],
  47. ['/views/views-view-grid.html.twig'],
  48. ['/views/views-view-list.html.twig'],
  49. ['/views/views-view-mapping-test.html.twig'],
  50. ['/views/views-view-opml.html.twig'],
  51. ['/views/views-view-row-opml.html.twig'],
  52. ['/views/views-view-rss.html.twig'],
  53. ['/views/views-view-unformatted.html.twig'],
  54. ];
  55. }
  56. }