Issue #3109935 by alexpott, bnjmnm: Improve ConfirmClassyCopiesTest
parent
54e060282b
commit
bc2f35cc4e
|
@ -17,25 +17,24 @@ use Drupal\KernelTests\KernelTestBase;
|
||||||
class ConfirmClassyCopiesTest extends KernelTestBase {
|
class ConfirmClassyCopiesTest extends KernelTestBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The theme handler.
|
* Tests Classy's assets have not been altered.
|
||||||
*
|
|
||||||
* @var \Drupal\Core\Extension\ThemeHandlerInterface
|
|
||||||
*/
|
*/
|
||||||
protected $themeHandler;
|
public function testClassyHashes() {
|
||||||
|
$theme_path = $this->container->get('extension.list.theme')->getPath('classy');
|
||||||
/**
|
foreach (['images', 'css', 'js'] as $type => $sub_folder) {
|
||||||
* {@inheritdoc}
|
$asset_path = "$theme_path/$sub_folder";
|
||||||
*/
|
$directory = new \RecursiveDirectoryIterator($asset_path, \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS);
|
||||||
protected function setUp() {
|
$iterator = new \RecursiveIteratorIterator($directory);
|
||||||
parent::setUp();
|
$this->assertGreaterThan(0, iterator_count($iterator));
|
||||||
|
foreach ($iterator as $fileinfo) {
|
||||||
$this->themeHandler = $this->container->get('theme_handler');
|
$filename = $fileinfo->getFilename();
|
||||||
$this->container->get('theme_installer')->install([
|
$this->assertSame(
|
||||||
'umami',
|
$this->getClassyHash($sub_folder, $filename),
|
||||||
'bartik',
|
md5_file($fileinfo->getPathname()),
|
||||||
'seven',
|
"$filename has expected hash"
|
||||||
'claro',
|
);
|
||||||
]);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,13 +48,16 @@ class ConfirmClassyCopiesTest extends KernelTestBase {
|
||||||
*
|
*
|
||||||
* @param string $theme
|
* @param string $theme
|
||||||
* The theme being tested.
|
* The theme being tested.
|
||||||
* @param string[] $file_hashes
|
* @param string $path_replace
|
||||||
* Provides an md5 hash for every asset copied from Classy.
|
* A string to replace paths found in CSS so relative URLs don't cuase the
|
||||||
|
* hash to differ.
|
||||||
|
* @param string[] $filenames
|
||||||
|
* Provides list of every asset copied from Classy.
|
||||||
*
|
*
|
||||||
* @dataProvider providerTestClassyCopies
|
* @dataProvider providerTestClassyCopies
|
||||||
*/
|
*/
|
||||||
public function testClassyCopies($theme, array $file_hashes) {
|
public function testClassyCopies($theme, $path_replace, array $filenames) {
|
||||||
$theme_path = $this->root . '/' . $this->themeHandler->getTheme($theme)->getPath();
|
$theme_path = $this->container->get('extension.list.theme')->getPath($theme);
|
||||||
|
|
||||||
foreach (['images', 'css', 'js'] as $sub_folder) {
|
foreach (['images', 'css', 'js'] as $sub_folder) {
|
||||||
$asset_path = "$theme_path/$sub_folder/classy";
|
$asset_path = "$theme_path/$sub_folder/classy";
|
||||||
|
@ -63,219 +65,228 @@ class ConfirmClassyCopiesTest extends KernelTestBase {
|
||||||
// potentially no Classy subdirectory for that type. Tests can be skipped
|
// potentially no Classy subdirectory for that type. Tests can be skipped
|
||||||
// for that type.
|
// for that type.
|
||||||
if (!file_exists($asset_path)) {
|
if (!file_exists($asset_path)) {
|
||||||
$this->assertEmpty($file_hashes[$sub_folder]);
|
$this->assertEmpty($filenames[$sub_folder]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create iterators to collect all files in a asset directory.
|
// Create iterators to collect all files in a asset directory.
|
||||||
$directory = new \RecursiveDirectoryIterator($asset_path);
|
$directory = new \RecursiveDirectoryIterator($asset_path, \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS);
|
||||||
$iterator = new \RecursiveIteratorIterator($directory);
|
$iterator = new \RecursiveIteratorIterator($directory);
|
||||||
$filecount = 0;
|
$filecount = 0;
|
||||||
foreach ($iterator as $fileinfo) {
|
foreach ($iterator as $fileinfo) {
|
||||||
$extension = $fileinfo->getExtension();
|
$filename = $fileinfo->getFilename();
|
||||||
if ($extension === $sub_folder || ($sub_folder === 'images' && $extension === 'png')) {
|
if ($filename === 'README.txt') {
|
||||||
$filecount++;
|
continue;
|
||||||
$filename = $fileinfo->getFilename();
|
|
||||||
$hash = md5_file($fileinfo->getPathname());
|
|
||||||
$this->assertNotEmpty($file_hashes[$sub_folder][$filename], "$sub_folder file: $filename not present.");
|
|
||||||
$this->assertEquals(
|
|
||||||
$file_hashes[$sub_folder][$filename],
|
|
||||||
$hash,
|
|
||||||
"$filename is in the theme's /classy subdirectory, but the file contents no longer match the original file from Classy. This should be moved to a new directory and libraries should be updated. The file can be removed from the data provider."
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filecount++;
|
||||||
|
|
||||||
|
// Replace paths in the contents so the hash will match Classy's hashes.
|
||||||
|
$contents = file_get_contents($fileinfo->getPathname());
|
||||||
|
$contents = str_replace('(' . $path_replace, '(../../../../', $contents);
|
||||||
|
$contents = str_replace('(../../../images/classy/icons', '(../../images/icons', $contents);
|
||||||
|
|
||||||
|
$this->assertContains($filename, $filenames[$sub_folder], "$sub_folder file: $filename not present.");
|
||||||
|
$this->assertSame(
|
||||||
|
$this->getClassyHash($sub_folder, $filename),
|
||||||
|
md5($contents),
|
||||||
|
"$filename is in the theme's /classy subdirectory, but the file contents no longer match the original file from Classy. This should be moved to a new directory and libraries should be updated. The file can be removed from the data provider."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$this->assertCount($filecount, $file_hashes[$sub_folder], "Different count for $sub_folder files in the /classy subdirectory. If a file was added to /classy, it shouldn't have been. If it was intentionally removed, it should also be removed from this test's data provider.");
|
$this->assertCount($filecount, $filenames[$sub_folder], "Different count for $sub_folder files in the /classy subdirectory. If a file was added to /classy, it shouldn't have been. If it was intentionally removed, it should also be removed from this test's data provider.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides md5 hashes for a theme's asset files copied from Classy.
|
* Provides lists of filenames for a theme's asset files copied from Classy.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* Theme name and asset file hashes.
|
* Theme name, how to replace a path to core assets and asset file names.
|
||||||
*/
|
*/
|
||||||
public function providerTestClassyCopies() {
|
public function providerTestClassyCopies() {
|
||||||
return [
|
return [
|
||||||
'umami' => [
|
'umami' => [
|
||||||
'theme-name' => 'umami',
|
'theme-name' => 'umami',
|
||||||
'file-hashes' => [
|
'path-replace' => '../../../../../../../',
|
||||||
|
'filenames' => [
|
||||||
'css' => [
|
'css' => [
|
||||||
'media-library.css' => 'bb405519d30970c721405452dfb7b38e',
|
'action-links.css',
|
||||||
'action-links.css' => '6abb88c2b3b6884c1a64fa5ca4853d45',
|
'book-navigation.css',
|
||||||
'file.css' => 'b644547e5e8eb6aa23505b307dc69c32',
|
'breadcrumb.css',
|
||||||
'dropbutton.css' => 'f8e4b0b81ff60206b27f622e85a6a0ee',
|
'button.css',
|
||||||
'book-navigation.css' => 'e8219368d360bd4a10763610ada85a1c',
|
'collapse-processed.css',
|
||||||
'tableselect.css' => '8e966ac85a0cc60f470717410640c8fe',
|
'container-inline.css',
|
||||||
'ui-dialog.css' => '4a3d036007ba8c8c80f4a21a369c72cc',
|
'details.css',
|
||||||
'user.css' => '0ec6acc22567a7c9c228f04b5a97c711',
|
'dialog.css',
|
||||||
'item-list.css' => '1d519afe6007f4b01e00f22b0ba8bf33',
|
'dropbutton.css',
|
||||||
'image-widget.css' => '2da54829199f64a2c390930c3b0913a3',
|
'exposed-filters.css',
|
||||||
'field.css' => '8f4718bc926eea7e007ecfd6f410ee8d',
|
'field.css',
|
||||||
'tablesort.css' => 'f6ed3b44832bebffa09fc3b4b6ce27ab',
|
'file.css',
|
||||||
'tabs.css' => 'e58827db5c767c41b67488244c14056c',
|
'form.css',
|
||||||
'forum.css' => '297a40db815570c2195515767c4b3144',
|
'forum.css',
|
||||||
'progress.css' => '5147a9b07ede9f456c6a3f3efeb520e1',
|
'icons.css',
|
||||||
'collapse-processed.css' => '95039b6f71bbdd3c986179f075f74d2f',
|
'image-widget.css',
|
||||||
'details.css' => 'fdd0606ea856072f5e6a19ab1a2e850e',
|
'inline-form.css',
|
||||||
'inline-form.css' => 'cc5cbfd34511d9021a53ec693c110740',
|
'item-list.css',
|
||||||
'link.css' => '22f42d430fe458080a7739c70a2d2ea5',
|
'link.css',
|
||||||
'textarea.css' => '2bc390c137c5205bbcd7645d6c1c86de',
|
'links.css',
|
||||||
'links.css' => '21fe64349f5702cd5b89104a1d3b9cd3',
|
'media-embed-error.css',
|
||||||
'form.css' => 'f9bd159b5ed0e1bfb2ca8d759e8c031c',
|
'media-library.css',
|
||||||
'exposed-filters.css' => '396a5f76dafec5f78f4e736f69a0874f',
|
'menu.css',
|
||||||
'tabledrag.css' => '98d24ff864c7699dfa6da9190c5e70df',
|
'more-link.css',
|
||||||
'pager.css' => 'd10589366720f9c15b66df434baab4da',
|
'node.css',
|
||||||
'search-results.css' => 'ce3ca8fcd54e72f142ba29da5a3a5c9a',
|
'pager.css',
|
||||||
'button.css' => '3abebf58e144fd4150d80facdbe5d10f',
|
'progress.css',
|
||||||
'node.css' => '81ea0a3fef211dbc32549ac7f39ec646',
|
'search-results.css',
|
||||||
'dialog.css' => '1c1f05dde2dff1b6befacaa811c019f8',
|
'tabledrag.css',
|
||||||
'menu.css' => 'b9587d2e8f71fe2bbc625fc40b989112',
|
'tableselect.css',
|
||||||
'icons.css' => 'c067e837e6e6d576734d443b7d40447b',
|
'tablesort.css',
|
||||||
'breadcrumb.css' => '14268f8071dffd40ce7a39862b8fbc56',
|
'tabs.css',
|
||||||
'media-embed-error.css' => 'c66322e308b78af92a30401326d19d52',
|
'textarea.css',
|
||||||
'container-inline.css' => 'ae9caee6071b319ac97bf0bb3e14b542',
|
'ui-dialog.css',
|
||||||
'more-link.css' => 'b2ebfb826e035334340193b42246b180',
|
'user.css',
|
||||||
],
|
],
|
||||||
'js' => [
|
'js' => [
|
||||||
'media_embed_ckeditor.theme.es6.js' => 'decf95c314bf22c642fb630179502e43',
|
'media_embed_ckeditor.theme.es6.js',
|
||||||
'media_embed_ckeditor.theme.js' => 'f8e192b79f25d2b61a6ff43b9733ec72',
|
'media_embed_ckeditor.theme.js',
|
||||||
],
|
],
|
||||||
'images' => [
|
'images' => [
|
||||||
'x-office-spreadsheet.png' => 'fc5d4b32f259ea6d0f960b17a0886f63',
|
'application-octet-stream.png',
|
||||||
'application-octet-stream.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
'application-pdf.png',
|
||||||
'x-office-presentation.png' => '8ba9f51c97a2b47de2c8c117aafd7dcd',
|
'application-x-executable.png',
|
||||||
'x-office-document.png' => '48e0c92b5dec1a027f43a5c6fe190f39',
|
'audio-x-generic.png',
|
||||||
'image-x-generic.png' => '9aca2e02c3cdbb391ca721d40fa4c0c6',
|
'forum-icons.png',
|
||||||
'text-x-script.png' => 'f9dc156d35298536011ea48226b21682',
|
'image-x-generic.png',
|
||||||
'text-html.png' => '9d2d3003a786ab392d42744b2d064eec',
|
'package-x-generic.png',
|
||||||
'video-x-generic.png' => 'a5dc89b884a8a1b666c15bb41fd88ee9',
|
'text-html.png',
|
||||||
'forum-icons.png' => 'dfa091b192819cc14523ccd653e7b5ff',
|
'text-plain.png',
|
||||||
'text-x-generic.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
'text-x-generic.png',
|
||||||
'application-pdf.png' => 'bb41f8b679b9d93323b30c87fde14de9',
|
'text-x-script.png',
|
||||||
'application-x-executable.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
'video-x-generic.png',
|
||||||
'package-x-generic.png' => 'bb8581301a2030b48ff3c67374eed88a',
|
'x-office-document.png',
|
||||||
'text-plain.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
'x-office-presentation.png',
|
||||||
'audio-x-generic.png' => 'f7d0e6fbcde58594bd1102db95e3ea7b',
|
'x-office-spreadsheet.png',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'claro' => [
|
'claro' => [
|
||||||
'theme-name' => 'claro',
|
'theme-name' => 'claro',
|
||||||
'file-hashes' => [
|
'path-replace' => '../../../../../',
|
||||||
|
'filenames' => [
|
||||||
'css' => [
|
'css' => [
|
||||||
'file.css' => 'b644547e5e8eb6aa23505b307dc69c32',
|
'book-navigation.css',
|
||||||
'book-navigation.css' => 'e8219368d360bd4a10763610ada85a1c',
|
'container-inline.css',
|
||||||
'ui-dialog.css' => '4a3d036007ba8c8c80f4a21a369c72cc',
|
'exposed-filters.css',
|
||||||
'item-list.css' => '1d519afe6007f4b01e00f22b0ba8bf33',
|
'field.css',
|
||||||
'field.css' => '8f4718bc926eea7e007ecfd6f410ee8d',
|
'file.css',
|
||||||
'tablesort.css' => 'f6ed3b44832bebffa09fc3b4b6ce27ab',
|
'forum.css',
|
||||||
'forum.css' => '297a40db815570c2195515767c4b3144',
|
'icons.css',
|
||||||
'inline-form.css' => 'cc5cbfd34511d9021a53ec693c110740',
|
'indented.css',
|
||||||
'link.css' => '22f42d430fe458080a7739c70a2d2ea5',
|
'inline-form.css',
|
||||||
'textarea.css' => '2bc390c137c5205bbcd7645d6c1c86de',
|
'item-list.css',
|
||||||
'links.css' => '21fe64349f5702cd5b89104a1d3b9cd3',
|
'link.css',
|
||||||
'exposed-filters.css' => '396a5f76dafec5f78f4e736f69a0874f',
|
'links.css',
|
||||||
'indented.css' => '48e214a106d9fede1e05aa10b4796361',
|
'media-embed-error.css',
|
||||||
'search-results.css' => 'ce3ca8fcd54e72f142ba29da5a3a5c9a',
|
'menu.css',
|
||||||
'node.css' => '81ea0a3fef211dbc32549ac7f39ec646',
|
'more-link.css',
|
||||||
'menu.css' => 'ddb533716fc3be2ad76f283c5532ee85',
|
'node.css',
|
||||||
'icons.css' => '85b21f21c0017e6a9fc83d00462904d0',
|
'search-results.css',
|
||||||
'media-embed-error.css' => '015171a1f01fff8e2bec4e06d9b451e7',
|
'tablesort.css',
|
||||||
'container-inline.css' => 'ae9caee6071b319ac97bf0bb3e14b542',
|
'textarea.css',
|
||||||
'more-link.css' => 'b2ebfb826e035334340193b42246b180',
|
'ui-dialog.css',
|
||||||
],
|
],
|
||||||
'js' => [
|
'js' => [
|
||||||
'media_embed_ckeditor.theme.es6.js' => 'decf95c314bf22c642fb630179502e43',
|
'media_embed_ckeditor.theme.es6.js',
|
||||||
'media_embed_ckeditor.theme.js' => 'f8e192b79f25d2b61a6ff43b9733ec72',
|
'media_embed_ckeditor.theme.js',
|
||||||
],
|
],
|
||||||
'images' => [
|
'images' => [
|
||||||
'x-office-spreadsheet.png' => 'fc5d4b32f259ea6d0f960b17a0886f63',
|
'application-octet-stream.png',
|
||||||
'application-octet-stream.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
'application-pdf.png',
|
||||||
'x-office-presentation.png' => '8ba9f51c97a2b47de2c8c117aafd7dcd',
|
'application-x-executable.png',
|
||||||
'x-office-document.png' => '48e0c92b5dec1a027f43a5c6fe190f39',
|
'audio-x-generic.png',
|
||||||
'image-x-generic.png' => '9aca2e02c3cdbb391ca721d40fa4c0c6',
|
'forum-icons.png',
|
||||||
'text-x-script.png' => 'f9dc156d35298536011ea48226b21682',
|
'image-x-generic.png',
|
||||||
'text-html.png' => '9d2d3003a786ab392d42744b2d064eec',
|
'package-x-generic.png',
|
||||||
'video-x-generic.png' => 'a5dc89b884a8a1b666c15bb41fd88ee9',
|
'text-html.png',
|
||||||
'forum-icons.png' => 'dfa091b192819cc14523ccd653e7b5ff',
|
'text-plain.png',
|
||||||
'text-x-generic.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
'text-x-generic.png',
|
||||||
'application-pdf.png' => 'bb41f8b679b9d93323b30c87fde14de9',
|
'text-x-script.png',
|
||||||
'application-x-executable.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
'video-x-generic.png',
|
||||||
'package-x-generic.png' => 'bb8581301a2030b48ff3c67374eed88a',
|
'x-office-document.png',
|
||||||
'text-plain.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
'x-office-presentation.png',
|
||||||
'audio-x-generic.png' => 'f7d0e6fbcde58594bd1102db95e3ea7b',
|
'x-office-spreadsheet.png',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'seven' => [
|
'seven' => [
|
||||||
'theme-name' => 'seven',
|
'theme-name' => 'seven',
|
||||||
'file-hashes' => [
|
'path-replace' => '../../../../../',
|
||||||
|
'filenames' => [
|
||||||
'css' => [
|
'css' => [
|
||||||
'media-library.css' => 'bb405519d30970c721405452dfb7b38e',
|
'action-links.css',
|
||||||
'action-links.css' => '6abb88c2b3b6884c1a64fa5ca4853d45',
|
'book-navigation.css',
|
||||||
'file.css' => 'b644547e5e8eb6aa23505b307dc69c32',
|
'breadcrumb.css',
|
||||||
'dropbutton.css' => 'f8e4b0b81ff60206b27f622e85a6a0ee',
|
'button.css',
|
||||||
'book-navigation.css' => 'e8219368d360bd4a10763610ada85a1c',
|
'collapse-processed.css',
|
||||||
'tableselect.css' => '8e966ac85a0cc60f470717410640c8fe',
|
'container-inline.css',
|
||||||
'ui-dialog.css' => '4a3d036007ba8c8c80f4a21a369c72cc',
|
'dropbutton.css',
|
||||||
'user.css' => '0ec6acc22567a7c9c228f04b5a97c711',
|
'exposed-filters.css',
|
||||||
'item-list.css' => '1d519afe6007f4b01e00f22b0ba8bf33',
|
'field.css',
|
||||||
'image-widget.css' => '2da54829199f64a2c390930c3b0913a3',
|
'file.css',
|
||||||
'field.css' => '8f4718bc926eea7e007ecfd6f410ee8d',
|
'form.css',
|
||||||
'tablesort.css' => 'f6ed3b44832bebffa09fc3b4b6ce27ab',
|
'forum.css',
|
||||||
'tabs.css' => 'e58827db5c767c41b67488244c14056c',
|
'icons.css',
|
||||||
'forum.css' => '297a40db815570c2195515767c4b3144',
|
'image-widget.css',
|
||||||
'progress.css' => '5147a9b07ede9f456c6a3f3efeb520e1',
|
'indented.css',
|
||||||
'collapse-processed.css' => 'a287a092b5af52ee41c9962776df073e',
|
'inline-form.css',
|
||||||
'inline-form.css' => 'cc5cbfd34511d9021a53ec693c110740',
|
'item-list.css',
|
||||||
'link.css' => '22f42d430fe458080a7739c70a2d2ea5',
|
'link.css',
|
||||||
'textarea.css' => '2bc390c137c5205bbcd7645d6c1c86de',
|
'links.css',
|
||||||
'links.css' => '21fe64349f5702cd5b89104a1d3b9cd3',
|
'media-embed-error.css',
|
||||||
'form.css' => '27ecf2f2e4627e292f0c48b5e05c4ef5',
|
'media-library.css',
|
||||||
'exposed-filters.css' => '396a5f76dafec5f78f4e736f69a0874f',
|
'menu.css',
|
||||||
'tabledrag.css' => '98d24ff864c7699dfa6da9190c5e70df',
|
'messages.css',
|
||||||
'indented.css' => '48e214a106d9fede1e05aa10b4796361',
|
'more-link.css',
|
||||||
'messages.css' => '21659ecd2f7ee6884805434329e6bea4',
|
'node.css',
|
||||||
'pager.css' => 'd10589366720f9c15b66df434baab4da',
|
'pager.css',
|
||||||
'search-results.css' => 'ce3ca8fcd54e72f142ba29da5a3a5c9a',
|
'progress.css',
|
||||||
'button.css' => '3abebf58e144fd4150d80facdbe5d10f',
|
'search-results.css',
|
||||||
'node.css' => '81ea0a3fef211dbc32549ac7f39ec646',
|
'tabledrag.css',
|
||||||
'menu.css' => 'ddb533716fc3be2ad76f283c5532ee85',
|
'tableselect.css',
|
||||||
'icons.css' => '85b21f21c0017e6a9fc83d00462904d0',
|
'tablesort.css',
|
||||||
'breadcrumb.css' => '14268f8071dffd40ce7a39862b8fbc56',
|
'tabs.css',
|
||||||
'media-embed-error.css' => '015171a1f01fff8e2bec4e06d9b451e7',
|
'textarea.css',
|
||||||
'container-inline.css' => 'ae9caee6071b319ac97bf0bb3e14b542',
|
'ui-dialog.css',
|
||||||
'more-link.css' => 'b2ebfb826e035334340193b42246b180',
|
'user.css',
|
||||||
],
|
],
|
||||||
'js' => [
|
'js' => [
|
||||||
'media_embed_ckeditor.theme.es6.js' => 'decf95c314bf22c642fb630179502e43',
|
'media_embed_ckeditor.theme.es6.js',
|
||||||
'media_embed_ckeditor.theme.js' => 'f8e192b79f25d2b61a6ff43b9733ec72',
|
'media_embed_ckeditor.theme.js',
|
||||||
],
|
],
|
||||||
'images' => [
|
'images' => [
|
||||||
'x-office-spreadsheet.png' => 'fc5d4b32f259ea6d0f960b17a0886f63',
|
'application-octet-stream.png',
|
||||||
'application-octet-stream.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
'application-pdf.png',
|
||||||
'x-office-presentation.png' => '8ba9f51c97a2b47de2c8c117aafd7dcd',
|
'application-x-executable.png',
|
||||||
'x-office-document.png' => '48e0c92b5dec1a027f43a5c6fe190f39',
|
'audio-x-generic.png',
|
||||||
'image-x-generic.png' => '9aca2e02c3cdbb391ca721d40fa4c0c6',
|
'forum-icons.png',
|
||||||
'text-x-script.png' => 'f9dc156d35298536011ea48226b21682',
|
'image-x-generic.png',
|
||||||
'text-html.png' => '9d2d3003a786ab392d42744b2d064eec',
|
'package-x-generic.png',
|
||||||
'video-x-generic.png' => 'a5dc89b884a8a1b666c15bb41fd88ee9',
|
'text-html.png',
|
||||||
'forum-icons.png' => 'dfa091b192819cc14523ccd653e7b5ff',
|
'text-plain.png',
|
||||||
'text-x-generic.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
'text-x-generic.png',
|
||||||
'application-pdf.png' => 'bb41f8b679b9d93323b30c87fde14de9',
|
'text-x-script.png',
|
||||||
'application-x-executable.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
'video-x-generic.png',
|
||||||
'package-x-generic.png' => 'bb8581301a2030b48ff3c67374eed88a',
|
'x-office-document.png',
|
||||||
'text-plain.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
'x-office-presentation.png',
|
||||||
'audio-x-generic.png' => 'f7d0e6fbcde58594bd1102db95e3ea7b',
|
'x-office-spreadsheet.png',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
// Will be populated when Classy libraries are copied to Bartik.
|
// Will be populated when Classy libraries are copied to Bartik.
|
||||||
'bartik' => [
|
'bartik' => [
|
||||||
'theme-name' => 'bartik',
|
'theme-name' => 'bartik',
|
||||||
'file-hashes' => [
|
'path-replace' => '../../../../../',
|
||||||
|
'filenames' => [
|
||||||
'css' => [],
|
'css' => [],
|
||||||
'js' => [],
|
'js' => [],
|
||||||
'images' => [],
|
'images' => [],
|
||||||
|
@ -284,4 +295,83 @@ class ConfirmClassyCopiesTest extends KernelTestBase {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the hash of a Classy asset.
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* The asset type.
|
||||||
|
* @param string $file
|
||||||
|
* The asset filename.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* A hash for the file.
|
||||||
|
*/
|
||||||
|
protected function getClassyHash($type, $file) {
|
||||||
|
static $hashes = [
|
||||||
|
'css' => [
|
||||||
|
'action-links.css' => '6abb88c2b3b6884c1a64fa5ca4853d45',
|
||||||
|
'book-navigation.css' => 'e8219368d360bd4a10763610ada85a1c',
|
||||||
|
'breadcrumb.css' => '14268f8071dffd40ce7a39862b8fbc56',
|
||||||
|
'button.css' => '3abebf58e144fd4150d80facdbe5d10f',
|
||||||
|
'collapse-processed.css' => 'e928df55485662a4499c9ba12def22e6',
|
||||||
|
'container-inline.css' => 'ae9caee6071b319ac97bf0bb3e14b542',
|
||||||
|
'details.css' => 'fdd0606ea856072f5e6a19ab1a2e850e',
|
||||||
|
'dialog.css' => 'f30e4423380f5f01d02ef0a93e010c53',
|
||||||
|
'dropbutton.css' => 'f8e4b0b81ff60206b27f622e85a6a0ee',
|
||||||
|
'exposed-filters.css' => '396a5f76dafec5f78f4e736f69a0874f',
|
||||||
|
'field.css' => '8f4718bc926eea7e007ecfd6f410ee8d',
|
||||||
|
'file.css' => '7f36f62ca67c57a82f9d9e882918a01b',
|
||||||
|
'form.css' => 'a8733b00eebffbc3293779cb779c808e',
|
||||||
|
'forum.css' => '8aad2d86dfd29818e991757581cd7ab8',
|
||||||
|
'icons.css' => '56f623bd343b9bc7e7ac3e3e95d7f3ce',
|
||||||
|
'image-widget.css' => '2da54829199f64a2c390930c3b0913a3',
|
||||||
|
'indented.css' => '48e214a106d9fede1e05aa10b4796361',
|
||||||
|
'inline-form.css' => 'cc5cbfd34511d9021a53ec693c110740',
|
||||||
|
'item-list.css' => '1d519afe6007f4b01e00f22b0ba8bf33',
|
||||||
|
'link.css' => '22f42d430fe458080a7739c70a2d2ea5',
|
||||||
|
'links.css' => '21fe64349f5702cd5b89104a1d3b9cd3',
|
||||||
|
'media-embed-error.css' => 'ab7f4c91f7b312122d30d7e09bb1bcc4',
|
||||||
|
'media-library.css' => 'bb405519d30970c721405452dfb7b38e',
|
||||||
|
'menu.css' => 'c4608b4ac9aafce1f6e0d21c6e6e6ee8',
|
||||||
|
'messages.css' => '2930ea9bebf4d1658e9bdc3b1f83bd43',
|
||||||
|
'more-link.css' => 'b2ebfb826e035334340193b42246b180',
|
||||||
|
'node.css' => '81ea0a3fef211dbc32549ac7f39ec646',
|
||||||
|
'pager.css' => 'd10589366720f9c15b66df434baab4da',
|
||||||
|
'progress.css' => '5147a9b07ede9f456c6a3f3efeb520e1',
|
||||||
|
'search-results.css' => 'ce3ca8fcd54e72f142ba29da5a3a5c9a',
|
||||||
|
'tabledrag.css' => '98d24ff864c7699dfa6da9190c5e70df',
|
||||||
|
'tableselect.css' => '8e966ac85a0cc60f470717410640c8fe',
|
||||||
|
'tablesort.css' => 'f6ed3b44832bebffa09fc3b4b6ce27ab',
|
||||||
|
'tabs.css' => 'e58827db5c767c41b67488244c14056c',
|
||||||
|
'textarea.css' => '2bc390c137c5205bbcd7645d6c1c86de',
|
||||||
|
'ui-dialog.css' => '4a3d036007ba8c8c80f4a21a369c72cc',
|
||||||
|
'user.css' => '0ec6acc22567a7c9c228f04b5a97c711',
|
||||||
|
],
|
||||||
|
'js' => [
|
||||||
|
'media_embed_ckeditor.theme.es6.js' => 'decf95c314bf22c642fb630179502e43',
|
||||||
|
'media_embed_ckeditor.theme.js' => 'f8e192b79f25d2b61a6ff43b9733ec72',
|
||||||
|
],
|
||||||
|
'images' => [
|
||||||
|
'application-octet-stream.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
||||||
|
'application-pdf.png' => 'bb41f8b679b9d93323b30c87fde14de9',
|
||||||
|
'application-x-executable.png' => 'fef73511632890590b5ae0a13c99e4bf',
|
||||||
|
'audio-x-generic.png' => 'f7d0e6fbcde58594bd1102db95e3ea7b',
|
||||||
|
'forum-icons.png' => 'dfa091b192819cc14523ccd653e7b5ff',
|
||||||
|
'image-x-generic.png' => '9aca2e02c3cdbb391ca721d40fa4c0c6',
|
||||||
|
'package-x-generic.png' => 'bb8581301a2030b48ff3c67374eed88a',
|
||||||
|
'text-html.png' => '9d2d3003a786ab392d42744b2d064eec',
|
||||||
|
'text-plain.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
||||||
|
'text-x-generic.png' => '1b769df473f54d6f78f7aba79ec25e12',
|
||||||
|
'text-x-script.png' => 'f9dc156d35298536011ea48226b21682',
|
||||||
|
'video-x-generic.png' => 'a5dc89b884a8a1b666c15bb41fd88ee9',
|
||||||
|
'x-office-document.png' => '48e0c92b5dec1a027f43a5c6fe190f39',
|
||||||
|
'x-office-presentation.png' => '8ba9f51c97a2b47de2c8c117aafd7dcd',
|
||||||
|
'x-office-spreadsheet.png' => 'fc5d4b32f259ea6d0f960b17a0886f63',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
$this->assertArrayHasKey($type, $hashes);
|
||||||
|
$this->assertArrayHasKey($file, $hashes[$type]);
|
||||||
|
return $hashes[$type][$file];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue