function ConfigTest::testMixedCaseConfigCleanupPackages
Same name in other branches
- 9 core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testMixedCaseConfigCleanupPackages()
- 8.9.x core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testMixedCaseConfigCleanupPackages()
- 10 core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testMixedCaseConfigCleanupPackages()
@covers ::getAllCleanupPaths
@runInSeparateProcess
File
-
core/
tests/ Drupal/ Tests/ Composer/ Plugin/ VendorHardening/ ConfigTest.php, line 84
Class
- ConfigTest
- @coversDefaultClass Drupal\Composer\Plugin\VendorHardening\Config @group VendorHardening
Namespace
Drupal\Tests\Composer\Plugin\VendorHardeningCode
public function testMixedCaseConfigCleanupPackages() : void {
// Root package has configuration in extra.
$root = $this->createMock(RootPackageInterface::class);
$root->expects($this->once())
->method('getExtra')
->willReturn([
'drupal-core-vendor-hardening' => [
'NotMikey179/vfsStream' => [
'src/test',
],
],
]);
$config = new Config($root);
$ref_plugin_config = new \ReflectionMethod($config, 'getAllCleanupPaths');
// Put some mixed-case in the defaults.
$ref_default = new \ReflectionProperty($config, 'defaultConfig');
$ref_default->setValue($config, [
'BeHatted/Monk' => [
'tests',
],
'SymPhony/HTTPFoundational' => [
'src',
],
]);
$plugin_config = $ref_plugin_config->invoke($config);
foreach (array_keys($plugin_config) as $package_name) {
$this->assertDoesNotMatchRegularExpression('/[A-Z]/', $package_name);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.