You are here

class ClassyTemplatesIdenticalToStableTest in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Theme/ClassyTemplatesIdenticalToStableTest.php \Drupal\Tests\Core\Theme\ClassyTemplatesIdenticalToStableTest

Confirms that certain Classy templates have identical equivalents in Stable.

@group Theme

Hierarchy

Expanded class hierarchy of ClassyTemplatesIdenticalToStableTest

File

core/tests/Drupal/Tests/Core/Theme/ClassyTemplatesIdenticalToStableTest.php, line 12

Namespace

Drupal\Tests\Core\Theme
View source
class ClassyTemplatesIdenticalToStableTest extends UnitTestCase {

  /**
   * Confirms that certain Classy templates have equivalents in Stable.
   *
   * @dataProvider providerTestStableTemplatesIdenticalToClassy
   *
   * @param string $template
   *   The template file to test.
   */
  public function testStableTemplatesIdenticalToClassy($template) {
    $stable_template = $this->root . '/core/themes/stable/templates' . $template;
    $classy_template = $this->root . '/core/themes/classy/templates' . $template;
    $this
      ->assertFileExists($stable_template);
    $this
      ->assertFileExists($classy_template);
    $this
      ->assertSame(md5_file($stable_template), md5_file($classy_template), 'The templates should have the same checksums.');
  }

  /**
   * A list of the Classy templates that have identical copies in Stable.
   */
  public function providerTestStableTemplatesIdenticalToClassy() {
    return [
      [
        '/content-edit/file-upload-help.html.twig',
      ],
      [
        '/content-edit/file-widget-multiple.html.twig',
      ],
      [
        '/field/image-formatter.html.twig',
      ],
      [
        '/field/image-style.html.twig',
      ],
      [
        '/form/checkboxes.html.twig',
      ],
      [
        '/form/confirm-form.html.twig',
      ],
      [
        '/form/container.html.twig',
      ],
      [
        '/form/dropbutton-wrapper.html.twig',
      ],
      [
        '/form/field-multiple-value-form.html.twig',
      ],
      [
        '/form/form.html.twig',
      ],
      [
        '/form/form-element-label.html.twig',
      ],
      [
        '/form/input.html.twig',
      ],
      [
        '/form/select.html.twig',
      ],
      [
        '/navigation/links.html.twig',
      ],
      [
        '/navigation/menu-local-action.html.twig',
      ],
      [
        '/navigation/pager.html.twig',
      ],
      [
        '/navigation/vertical-tabs.html.twig',
      ],
      [
        '/views/views-view-grid.html.twig',
      ],
      [
        '/views/views-view-list.html.twig',
      ],
      [
        '/views/views-view-mapping-test.html.twig',
      ],
      [
        '/views/views-view-opml.html.twig',
      ],
      [
        '/views/views-view-row-opml.html.twig',
      ],
      [
        '/views/views-view-rss.html.twig',
      ],
      [
        '/views/views-view-unformatted.html.twig',
      ],
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ClassyTemplatesIdenticalToStableTest::providerTestStableTemplatesIdenticalToClassy public function A list of the Classy templates that have identical copies in Stable.
ClassyTemplatesIdenticalToStableTest::testStableTemplatesIdenticalToClassy public function Confirms that certain Classy templates have equivalents in Stable.
PhpUnitWarnings::$deprecationWarnings private static property Deprecation warnings from PHPUnit to raise with @trigger_error().
PhpUnitWarnings::addWarning public function Converts PHPUnit deprecation warnings to E_USER_DEPRECATED.
UnitTestCase::$randomGenerator protected property The random generator.
UnitTestCase::$root protected property The app root. 1
UnitTestCase::assertArrayEquals Deprecated protected function Asserts if two arrays are equal by sorting them first.
UnitTestCase::getClassResolverStub protected function Returns a stub class resolver.
UnitTestCase::getConfigFactoryStub public function Returns a stub config factory that behaves according to the passed array.
UnitTestCase::getConfigStorageStub public function Returns a stub config storage that returns the supplied configuration.
UnitTestCase::getContainerWithCacheTagsInvalidator protected function Sets up a container with a cache tags invalidator.
UnitTestCase::getRandomGenerator protected function Gets the random generator for the utility methods.
UnitTestCase::getStringTranslationStub public function Returns a stub translation manager that just returns the passed string.
UnitTestCase::randomMachineName public function Generates a unique random string containing letters and numbers.
UnitTestCase::setUp protected function 308
UnitTestCase::setUpBeforeClass public static function