function ConfigTest::testNoRootMergeConfig

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testNoRootMergeConfig()
  2. 10 core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testNoRootMergeConfig()
  3. 11.x core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php \Drupal\Tests\Composer\Plugin\VendorHardening\ConfigTest::testNoRootMergeConfig()

@covers ::getAllCleanupPaths

File

core/tests/Drupal/Tests/Composer/Plugin/VendorHardening/ConfigTest.php, line 37

Class

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

Namespace

Drupal\Tests\Composer\Plugin\VendorHardening

Code

public function testNoRootMergeConfig() {
    // Root package has no extra field.
    $root = $this->getMockBuilder(RootPackageInterface::class)
        ->onlyMethods([
        'getExtra',
    ])
        ->getMockForAbstractClass();
    $root->expects($this->once())
        ->method('getExtra')
        ->willReturn([]);
    $config = new Config($root);
    $ref_default = new \ReflectionProperty($config, 'defaultConfig');
    $ref_default->setAccessible(TRUE);
    $ref_plugin_config = new \ReflectionMethod($config, 'getAllCleanupPaths');
    $ref_plugin_config->setAccessible(TRUE);
    $this->assertEquals($ref_default->getValue($config), $ref_plugin_config->invoke($config));
}

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