function ConfigTest::testRootMergeConfig

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testRootMergeConfig()
  2. 8.9.x core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testRootMergeConfig()
  3. 10 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 57

Class

ConfigTest
@coversDefaultClass <a href="/api/drupal/composer%21Plugin%21VendorHardening%21Config.php/class/Config/11.x" title="Determine configuration." class="local">Drupal\Composer\Plugin\VendorHardening\Config</a> @group VendorHardening

Namespace

Drupal\Tests\Composer\Plugin\VendorHardening

Code

public function testRootMergeConfig() : void {
    // Root package has configuration in extra.
    $root = $this->createMock(RootPackageInterface::class);
    $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');
    $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']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.