Commit de1c2060 authored by alexpott's avatar alexpott

Issue #2943860 by Mixologic, alexpott: Add a LICENSE.txt to Serialization and...

Issue #2943860 by Mixologic, alexpott: Add a LICENSE.txt to Serialization and Transliteration components
parent b5a5c681
......@@ -32,6 +32,34 @@ public function testNoCoreInComponentTests() {
}
}
/**
* Tests LICENSE.txt is present and has the correct content.
*
* @param $component_path
* The path to the component.
* @dataProvider \Drupal\Tests\Component\DrupalComponentTest::getComponents
*/
public function testComponentLicence($component_path) {
$this->assertFileExists($component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt');
$this->assertSame('e84dac1d9fbb5a4a69e38654ce644cea769aa76b', hash_file('sha1', $component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt'));
}
/**
* Data provider.
*
* @return array
*/
public function getComponents() {
$root_component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/lib/Drupal/Component';
$component_paths = [];
foreach (new \DirectoryIterator($root_component_path) as $file) {
if ($file->isDir() && !$file->isDot()) {
$component_paths[$file->getBasename()] = [$file->getPathname()];
}
}
return $component_paths;
}
/**
* Searches a directory recursively for PHP classes.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment