/** * Merges an info file into a package's info file. * * @param string $package_info * The Yaml encoded package info. * @param string $info_file_uri * The info file's URI. */ protected function mergeInfoFile($package_info, $info_file_uri) { $package_info = Yaml::decode($package_info); /** @var \Drupal\Core\Extension\InfoParserInterface $existing_info */ $existing_info = \Drupal::service('info_parser')->parse($info_file_uri); return Yaml::encode($this->featuresManager->mergeInfoArray($existing_info, $package_info)); }
/** * @todo This could have of course much more test coverage. * * @covers ::mergeInfoArray * * @dataProvider providerTestMergeInfoArray */ public function testMergeInfoArray($expected, $info1, $info2, $keys = []) { $this->assertSame($expected, $this->featuresManager->mergeInfoArray($info1, $info2, $keys)); }