Skip to content
Snippets Groups Projects
Commit fcf4aa59 authored by Kunal Sachdev's avatar Kunal Sachdev Committed by Adam G-H
Browse files

Issue #3344556 by kunal.sachdev, phenaproxima: Make ComposerInspector::getVersion() private

parent c52e9ab3
No related branches found
No related tags found
No related merge requests found
...@@ -229,10 +229,8 @@ class ComposerInspector { ...@@ -229,10 +229,8 @@ class ComposerInspector {
* *
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
* Thrown if the expect data format is not found. * Thrown if the expect data format is not found.
*
* @todo Make this method private in https://drupal.org/i/3344556.
*/ */
public function getVersion(string $working_dir): string { private function getVersion(string $working_dir): string {
$this->runner->run(['--format=json', "--working-dir=$working_dir"], $this->jsonCallback); $this->runner->run(['--format=json', "--working-dir=$working_dir"], $this->jsonCallback);
$data = $this->jsonCallback->getOutputData(); $data = $this->jsonCallback->getOutputData();
if (isset($data['application']['name']) if (isset($data['application']['name'])
......
...@@ -59,20 +59,6 @@ class ComposerInspectorTest extends PackageManagerKernelTestBase { ...@@ -59,20 +59,6 @@ class ComposerInspectorTest extends PackageManagerKernelTestBase {
$inspector->getConfig('extra', $dir); $inspector->getConfig('extra', $dir);
} }
/**
* @covers ::getVersion
*/
public function testGetVersion() {
$dir = __DIR__ . '/../../fixtures/fake_site';
$inspector = $this->container->get('package_manager.composer_inspector');
$version = $inspector->getVersion($dir);
// We can assert an exact version of Composer, but we can assert that the
// number is in the expected 'MAJOR.MINOR.PATCH' format.
$parts = explode('.', $version);
$this->assertCount(3, $parts);
$this->assertCount(3, array_filter($parts, 'is_numeric'));
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment