You are here

class ClassyPreprocessUnchangedTest in Drupal 9

Confirms that classy.theme has not added new functionality.

@group Theme

Hierarchy

Expanded class hierarchy of ClassyPreprocessUnchangedTest

File

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

Namespace

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

  /**
   * Confirms that classy.theme has not added any new functionality.
   *
   * Part of Classy decoupling includes no longer depending on the functionality
   * in classy.theme. This test confirms that classy.theme has not been changed.
   * If a change has occurred the test will fail and provide a warning that all
   * functionality changes should be moved to the themes inheriting Classy.
   */
  public function testNoNewPreprocess() {
    $classy_theme_contents = file_get_contents($this->root . '/core/themes/classy/classy.theme');
    $hash = md5($classy_theme_contents);
    $this
      ->assertSame($hash, 'c42ff3a1291a258b42f0c44010cd28c7', "The file hash for classy.theme has changed. Any additions or changes to preprocess functions should be added to the themes that inherit Classy. \nIf the changes to classy.theme are not changes to preprocess functions, update the hash in this test to: '{$hash}' so it will pass.");
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ClassyPreprocessUnchangedTest::testNoNewPreprocess public function Confirms that classy.theme has not added any new functionality.
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