public function ConfigTest::testRootMergeConfig in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testRootMergeConfig()
- 9 core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testRootMergeConfig()
@covers ::getAllCleanupPaths
File
- core/
tests/ Drupal/ Tests/ Composer/ Plugin/ VendorHardening/ ConfigTest.php, line 62
Class
- ConfigTest
- @coversDefaultClass Drupal\Composer\Plugin\VendorHardening\Config @group VendorHardening
Namespace
Drupal\Tests\Composer\Plugin\VendorHardeningCode
public function testRootMergeConfig() {
// Root package has configuration in extra.
$root = $this
->getMockBuilder(RootPackageInterface::class)
->onlyMethods([
'getExtra',
])
->getMockForAbstractClass();
$root
->expects($this
->once())
->method('getExtra')
->willReturn([
'drupal-core-vendor-hardening' => [
'isa/string' => 'test_dir',
'an/array' => [
'test_dir',
'doc_dir',
],
],
]);
$config = new Config($root);
$ref_plugin_config = new \ReflectionMethod($config, 'getAllCleanupPaths');
$ref_plugin_config
->setAccessible(TRUE);
$plugin_config = $ref_plugin_config
->invoke($config);
$this
->assertSame([
'test_dir',
], $plugin_config['isa/string']);
$this
->assertSame([
'test_dir',
'doc_dir',
], $plugin_config['an/array']);
}