Fixes --version and --help

This commit is contained in:
Nuno Maduro
2022-09-17 23:47:47 +01:00
parent 08b62f6633
commit 0e0e2adfbe
26 changed files with 511 additions and 86 deletions

View File

@ -1,21 +0,0 @@
<?php
use Pest\Plugins\Version;
use function Pest\version;
use Symfony\Component\Console\Output\BufferedOutput;
it('outputs the version when --version is used', function () {
$output = new BufferedOutput();
$plugin = new Version($output);
$plugin->handleArguments(['foo', '--version']);
expect($output->fetch())->toContain('Pest '.version());
});
it('do not outputs version when --version is not used', function () {
$output = new BufferedOutput();
$plugin = new Version($output);
$plugin->handleArguments(['foo', 'bar']);
expect($output->fetch())->toBe('');
});