Skip to content

Commit 22859e7

Browse files
committed
Fix coverage metadata for command tests
1 parent 9ab54d9 commit 22859e7

31 files changed

Lines changed: 282 additions & 46 deletions

tests/Composer/Capability/DevToolsCommandProviderTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use FastForward\DevTools\Container\ContainerFactory;
2727
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
2828
use FastForward\DevTools\Path\DevToolsPathResolver;
29+
use FastForward\DevTools\Console\Output\GithubActionOutput;
2930
use PHPUnit\Framework\Attributes\CoversClass;
3031
use PHPUnit\Framework\Attributes\Test;
3132
use PHPUnit\Framework\Attributes\UsesClass;
@@ -34,6 +35,7 @@
3435
use Prophecy\Prophecy\ObjectProphecy;
3536
use stdClass;
3637

38+
#[UsesClass(GithubActionOutput::class)]
3739
#[CoversClass(DevToolsCommandProvider::class)]
3840
#[UsesClass(ContainerFactory::class)]
3941
#[UsesClass(DevToolsPathResolver::class)]
@@ -92,8 +94,7 @@ protected function setUp(): void
9294
ContainerFactory::set('FastForward\DevTools\Console\DevTools', new class ($this->applicationState) {
9395
public function __construct(
9496
private readonly stdClass $state,
95-
) {
96-
}
97+
) {}
9798

9899
/**
99100
* @return array<string, FixtureWithoutAsCommand>
@@ -137,7 +138,9 @@ public function getCommandsWillReturnComposerProxyCommandsForRegisteredSymfonyCo
137138
$symfonyCommand->setHelp('');
138139
$symfonyCommand->setHidden(false);
139140

140-
$this->applicationCommands = ['agents' => $symfonyCommand];
141+
$this->applicationCommands = [
142+
'agents' => $symfonyCommand,
143+
];
141144

142145
$commands = array_values($this->commandProvider->getCommands());
143146
$command = $commands[0];
@@ -234,7 +237,9 @@ public function getCommandsWillNotExposeCommandsOwnedByComposer(): void
234237
$symfonyCommand->setHelp('');
235238
$symfonyCommand->setHidden(false);
236239

237-
$this->applicationCommands = ['install' => $symfonyCommand];
240+
$this->applicationCommands = [
241+
'install' => $symfonyCommand,
242+
];
238243

239244
self::assertSame([], $this->commandProvider->getCommands());
240245
}

tests/Console/Command/AgentsCommandTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
use FastForward\DevTools\Path\DevToolsPathResolver;
2626
use FastForward\DevTools\Sync\PackagedDirectorySynchronizer;
2727
use FastForward\DevTools\Sync\SynchronizeResult;
28+
use FastForward\DevTools\Container\ContainerFactory;
29+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
30+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
31+
use FastForward\DevTools\Environment\RuntimeEnvironment;
2832
use PHPUnit\Framework\Attributes\CoversClass;
2933
use PHPUnit\Framework\Attributes\Test;
3034
use PHPUnit\Framework\Attributes\UsesClass;
@@ -41,6 +45,10 @@
4145

4246
use function Safe\getcwd;
4347

48+
#[UsesClass(ContainerFactory::class)]
49+
#[UsesClass(DevToolsServiceProvider::class)]
50+
#[UsesClass(DevToolsEnvironment::class)]
51+
#[UsesClass(RuntimeEnvironment::class)]
4452
#[CoversClass(AgentsCommand::class)]
4553
#[UsesClass(DevToolsPathResolver::class)]
4654
#[UsesClass(PackagedDirectorySynchronizer::class)]
@@ -82,10 +90,7 @@ protected function setUp(): void
8290
$this->filesystem->getAbsolutePath('.agents/agents')
8391
->willReturn(getcwd() . '/.agents/agents');
8492

85-
$this->command = new AgentsCommand(
86-
$this->synchronizer->reveal(),
87-
$this->filesystem->reveal(),
88-
);
93+
$this->command = new AgentsCommand($this->synchronizer->reveal(), $this->filesystem->reveal());
8994
}
9095

9196
/**

tests/Console/Command/ChangelogCheckCommandTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@
2525
use FastForward\DevTools\Filesystem\FilesystemInterface;
2626
use Psr\Log\LoggerInterface;
2727
use FastForward\DevTools\Tests\Container\UsesContainerFactory;
28+
use FastForward\DevTools\Container\ContainerFactory;
29+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
30+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
31+
use FastForward\DevTools\Environment\RuntimeEnvironment;
32+
use FastForward\DevTools\Path\DevToolsPathResolver;
2833
use PHPUnit\Framework\Attributes\CoversClass;
2934
use PHPUnit\Framework\Attributes\Test;
35+
use PHPUnit\Framework\Attributes\UsesClass;
3036
use PHPUnit\Framework\Attributes\UsesTrait;
3137
use PHPUnit\Framework\TestCase;
3238
use Prophecy\Argument;
@@ -36,6 +42,11 @@
3642
use Symfony\Component\Console\Input\InputInterface;
3743
use Symfony\Component\Console\Output\OutputInterface;
3844

45+
#[UsesClass(ContainerFactory::class)]
46+
#[UsesClass(DevToolsPathResolver::class)]
47+
#[UsesClass(DevToolsServiceProvider::class)]
48+
#[UsesClass(DevToolsEnvironment::class)]
49+
#[UsesClass(RuntimeEnvironment::class)]
3950
#[CoversClass(ChangelogCheckCommand::class)]
4051
#[UsesTrait(LogsCommandResults::class)]
4152
final class ChangelogCheckCommandTest extends TestCase
@@ -83,10 +94,7 @@ protected function setUp(): void
8394
->willReturn('CHANGELOG.md');
8495
$this->filesystem->getAbsolutePath('CHANGELOG.md')
8596
->willReturn('/repo/CHANGELOG.md');
86-
$this->command = new ChangelogCheckCommand(
87-
$this->filesystem->reveal(),
88-
$this->checker->reveal(),
89-
);
97+
$this->command = new ChangelogCheckCommand($this->filesystem->reveal(), $this->checker->reveal());
9098
}
9199

92100
/**

tests/Console/Command/ChangelogEntryCommandTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@
2323
use FastForward\DevTools\Changelog\Manager\ChangelogManagerInterface;
2424
use FastForward\DevTools\Console\Command\ChangelogEntryCommand;
2525
use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
26+
use FastForward\DevTools\Console\Output\GithubActionOutput;
2627
use FastForward\DevTools\Filesystem\FilesystemInterface;
28+
use FastForward\DevTools\Container\ContainerFactory;
29+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
30+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
31+
use FastForward\DevTools\Environment\RuntimeEnvironment;
32+
use FastForward\DevTools\Path\DevToolsPathResolver;
2733
use PHPUnit\Framework\Attributes\CoversClass;
2834
use PHPUnit\Framework\Attributes\Test;
2935
use PHPUnit\Framework\Attributes\UsesClass;
@@ -37,6 +43,12 @@
3743
use Symfony\Component\Console\Input\InputInterface;
3844
use Symfony\Component\Console\Output\OutputInterface;
3945

46+
#[UsesClass(ContainerFactory::class)]
47+
#[UsesClass(DevToolsPathResolver::class)]
48+
#[UsesClass(DevToolsServiceProvider::class)]
49+
#[UsesClass(DevToolsEnvironment::class)]
50+
#[UsesClass(RuntimeEnvironment::class)]
51+
#[UsesClass(GithubActionOutput::class)]
4052
#[CoversClass(ChangelogEntryCommand::class)]
4153
#[UsesClass(ChangelogEntryType::class)]
4254
#[UsesTrait(LogsCommandResults::class)]

tests/Console/Command/ChangelogNextVersionCommandTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@
2323
use FastForward\DevTools\Console\Command\ChangelogNextVersionCommand;
2424
use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
2525
use FastForward\DevTools\Filesystem\FilesystemInterface;
26+
use FastForward\DevTools\Container\ContainerFactory;
27+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
28+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
29+
use FastForward\DevTools\Environment\RuntimeEnvironment;
30+
use FastForward\DevTools\Path\DevToolsPathResolver;
2631
use PHPUnit\Framework\Attributes\CoversClass;
2732
use PHPUnit\Framework\Attributes\Test;
33+
use PHPUnit\Framework\Attributes\UsesClass;
2834
use PHPUnit\Framework\Attributes\UsesTrait;
2935
use PHPUnit\Framework\TestCase;
3036
use Prophecy\PhpUnit\ProphecyTrait;
@@ -37,6 +43,11 @@
3743
use Symfony\Component\Console\Input\InputInterface;
3844
use Symfony\Component\Console\Output\OutputInterface;
3945

46+
#[UsesClass(ContainerFactory::class)]
47+
#[UsesClass(DevToolsPathResolver::class)]
48+
#[UsesClass(DevToolsServiceProvider::class)]
49+
#[UsesClass(DevToolsEnvironment::class)]
50+
#[UsesClass(RuntimeEnvironment::class)]
4051
#[CoversClass(ChangelogNextVersionCommand::class)]
4152
#[UsesTrait(LogsCommandResults::class)]
4253
final class ChangelogNextVersionCommandTest extends TestCase

tests/Console/Command/ChangelogPromoteCommandTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@
2424
use FastForward\DevTools\Console\Command\ChangelogPromoteCommand;
2525
use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
2626
use FastForward\DevTools\Filesystem\FilesystemInterface;
27+
use FastForward\DevTools\Container\ContainerFactory;
28+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
29+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
30+
use FastForward\DevTools\Environment\RuntimeEnvironment;
31+
use FastForward\DevTools\Path\DevToolsPathResolver;
2732
use PHPUnit\Framework\Attributes\CoversClass;
2833
use PHPUnit\Framework\Attributes\Test;
34+
use PHPUnit\Framework\Attributes\UsesClass;
2935
use PHPUnit\Framework\Attributes\UsesTrait;
3036
use PHPUnit\Framework\TestCase;
3137
use Prophecy\PhpUnit\ProphecyTrait;
@@ -38,6 +44,11 @@
3844
use Symfony\Component\Console\Input\InputInterface;
3945
use Symfony\Component\Console\Output\OutputInterface;
4046

47+
#[UsesClass(ContainerFactory::class)]
48+
#[UsesClass(DevToolsPathResolver::class)]
49+
#[UsesClass(DevToolsServiceProvider::class)]
50+
#[UsesClass(DevToolsEnvironment::class)]
51+
#[UsesClass(RuntimeEnvironment::class)]
4152
#[CoversClass(ChangelogPromoteCommand::class)]
4253
#[UsesTrait(LogsCommandResults::class)]
4354
final class ChangelogPromoteCommandTest extends TestCase

tests/Console/Command/ChangelogShowCommandTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@
2323
use FastForward\DevTools\Console\Command\ChangelogShowCommand;
2424
use FastForward\DevTools\Console\Command\Traits\LogsCommandResults;
2525
use FastForward\DevTools\Filesystem\FilesystemInterface;
26+
use FastForward\DevTools\Container\ContainerFactory;
27+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
28+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
29+
use FastForward\DevTools\Environment\RuntimeEnvironment;
30+
use FastForward\DevTools\Path\DevToolsPathResolver;
2631
use PHPUnit\Framework\Attributes\CoversClass;
2732
use PHPUnit\Framework\Attributes\Test;
33+
use PHPUnit\Framework\Attributes\UsesClass;
2834
use PHPUnit\Framework\Attributes\UsesTrait;
2935
use PHPUnit\Framework\TestCase;
3036
use Prophecy\PhpUnit\ProphecyTrait;
@@ -37,6 +43,11 @@
3743
use Symfony\Component\Console\Input\InputInterface;
3844
use Symfony\Component\Console\Output\OutputInterface;
3945

46+
#[UsesClass(ContainerFactory::class)]
47+
#[UsesClass(DevToolsPathResolver::class)]
48+
#[UsesClass(DevToolsServiceProvider::class)]
49+
#[UsesClass(DevToolsEnvironment::class)]
50+
#[UsesClass(RuntimeEnvironment::class)]
4051
#[CoversClass(ChangelogShowCommand::class)]
4152
#[UsesTrait(LogsCommandResults::class)]
4253
final class ChangelogShowCommandTest extends TestCase
@@ -79,10 +90,7 @@ protected function setUp(): void
7990
$this->filesystem->getAbsolutePath('CHANGELOG.md')
8091
->willReturn('/repo/CHANGELOG.md');
8192

82-
$this->command = new ChangelogShowCommand(
83-
$this->filesystem->reveal(),
84-
$this->changelogManager->reveal(),
85-
);
93+
$this->command = new ChangelogShowCommand($this->filesystem->reveal(), $this->changelogManager->reveal());
8694
}
8795

8896
/**

tests/Console/Command/CodeOwnersCommandTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
use FastForward\DevTools\Filesystem\FilesystemInterface;
2828
use FastForward\DevTools\Resource\FileDiff;
2929
use FastForward\DevTools\Resource\FileDiffer;
30+
use FastForward\DevTools\Container\ContainerFactory;
31+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
32+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
33+
use FastForward\DevTools\Environment\RuntimeEnvironment;
34+
use FastForward\DevTools\Path\DevToolsPathResolver;
3035
use PHPUnit\Framework\Attributes\CoversClass;
3136
use PHPUnit\Framework\Attributes\Test;
3237
use PHPUnit\Framework\Attributes\UsesClass;
@@ -41,6 +46,11 @@
4146
use Symfony\Component\Console\Input\InputInterface;
4247
use Symfony\Component\Console\Output\OutputInterface;
4348

49+
#[UsesClass(ContainerFactory::class)]
50+
#[UsesClass(DevToolsPathResolver::class)]
51+
#[UsesClass(DevToolsServiceProvider::class)]
52+
#[UsesClass(DevToolsEnvironment::class)]
53+
#[UsesClass(RuntimeEnvironment::class)]
4454
#[CoversClass(CodeOwnersCommand::class)]
4555
#[UsesClass(FileDiff::class)]
4656
#[UsesTrait(LogsCommandResults::class)]

tests/Console/Command/CodeStyleCommandTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
use FastForward\DevTools\Path\WorkingProjectPathResolver;
2626
use FastForward\DevTools\Process\ProcessBuilderInterface;
2727
use FastForward\DevTools\Process\ProcessQueueInterface;
28+
use FastForward\DevTools\Container\ContainerFactory;
29+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
30+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
31+
use FastForward\DevTools\Environment\RuntimeEnvironment;
2832
use PHPUnit\Framework\Attributes\CoversClass;
2933
use PHPUnit\Framework\Attributes\Test;
3034
use PHPUnit\Framework\Attributes\UsesClass;
@@ -42,6 +46,10 @@
4246
use Symfony\Component\Console\Output\OutputInterface;
4347
use Symfony\Component\Process\Process;
4448

49+
#[UsesClass(ContainerFactory::class)]
50+
#[UsesClass(DevToolsServiceProvider::class)]
51+
#[UsesClass(DevToolsEnvironment::class)]
52+
#[UsesClass(RuntimeEnvironment::class)]
4553
#[CoversClass(CodeStyleCommand::class)]
4654
#[UsesClass(DevToolsPathResolver::class)]
4755
#[UsesClass(WorkingProjectPathResolver::class)]

tests/Console/Command/CopyResourceCommandTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
use FastForward\DevTools\Filesystem\FilesystemInterface;
2727
use FastForward\DevTools\Resource\FileDiff;
2828
use FastForward\DevTools\Resource\FileDiffer;
29+
use FastForward\DevTools\Container\ContainerFactory;
30+
use FastForward\DevTools\Container\ServiceProvider\DevToolsServiceProvider;
31+
use FastForward\DevTools\Environment\Environment as DevToolsEnvironment;
32+
use FastForward\DevTools\Environment\RuntimeEnvironment;
33+
use FastForward\DevTools\Path\DevToolsPathResolver;
2934
use PHPUnit\Framework\Attributes\CoversClass;
3035
use PHPUnit\Framework\Attributes\Test;
3136
use PHPUnit\Framework\Attributes\UsesClass;
@@ -46,6 +51,11 @@
4651
use function Safe\unlink;
4752
use function Safe\rmdir;
4853

54+
#[UsesClass(ContainerFactory::class)]
55+
#[UsesClass(DevToolsPathResolver::class)]
56+
#[UsesClass(DevToolsServiceProvider::class)]
57+
#[UsesClass(DevToolsEnvironment::class)]
58+
#[UsesClass(RuntimeEnvironment::class)]
4959
#[CoversClass(CopyResourceCommand::class)]
5060
#[UsesClass(FileDiff::class)]
5161
final class CopyResourceCommandTest extends TestCase

0 commit comments

Comments
 (0)