这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mihai-stancu
Copy link
Contributor

Hi,

I'm trying to add phive as an installer here. It's prepackaged to do what phar-download does and I've seen various tool starting to recommend it as "the way" to install their tool.

WDYT?

@jakzal
Copy link
Owner

jakzal commented Feb 20, 2021

Great idea. It should be prefered over phar-download 👍

@jakzal
Copy link
Owner

jakzal commented Feb 20, 2021

To help with infection coverage you should add a test to the InstallToolsTest. Similar to the one for phar-download:

public function test_it_includes_phar_download_commands()
{
$this->tools->all(Argument::type(Filter::class))->willReturn(Collection::create([
$this->tool(new PharDownloadCommand('https://github.com/sensiolabs-de/deptrac/releases/download/0.2.0/deptrac-0.2.0.phar', '/tools/phar')),
]));
$command = $this->useCase->__invoke($this->filter());
$this->assertMatchesRegularExpression('#curl[^&]*?deptrac-0.2.0.phar#', (string)$command);
}

@mihai-stancu
Copy link
Contributor Author

Question: (as a matter of test philosophy) since you (fully) control the input, then why use regex to match the output, why not match against the exact expected command string?

@jakzal
Copy link
Owner

jakzal commented Feb 22, 2021

Question: (as a matter of test philosophy) since you (fully) control the input, then why use regex to match the output, why not match against the exact expected command string?

If the test was checking for the exact output, it would be more coupled to the implementation. All I want to make sure here is that curl is called to download the phar. I don't care about specific options or the order. The actual command invocation is tested in the integrated test.

@mihai-stancu
Copy link
Contributor Author

Alright, 10q for the clarification.

I'll pingback in a couple of days -- when I find the time to finish this.

@jakzal
Copy link
Owner

jakzal commented Feb 23, 2021

No rush! Thank you for working on this.

@mihai-stancu
Copy link
Contributor Author

I'll close this one since the integration tests here aren't revealing faults in the implementation and we'll rely on #369 to finish the job.

@mihai-stancu mihai-stancu deleted the phive branch March 3, 2021 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants