Skip to content

Commit

Permalink
[TASK] Enable strict coverage metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertsoft committed Jun 3, 2023
1 parent 6f1df4d commit 5fbc84b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
beStrictAboutCoverageMetadata="false"
beStrictAboutCoverageMetadata="true"
>
<coverage
cacheDirectory="var/cache/coverage"
Expand Down
6 changes: 6 additions & 0 deletions tests/Unit/Console/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Tester\ApplicationTester;
use TYPO3\CodingStandards\Console\Application;
use TYPO3\CodingStandards\Console\Command\AbstractSetupCommand;
use TYPO3\CodingStandards\Console\Command\SetupCommand;
use TYPO3\CodingStandards\Console\Command\TypeTrait;
use TYPO3\CodingStandards\Tests\Unit\TestCase;

#[\PHPUnit\Framework\Attributes\CoversClass(Application::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(AbstractSetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(SetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(TypeTrait::class)]
final class ApplicationTest extends TestCase
{
public function testApplication(): void
Expand Down
14 changes: 12 additions & 2 deletions tests/Unit/Console/Command/AbstractSetupCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,26 @@
namespace TYPO3\CodingStandards\Tests\Unit\Console\Command;

use RuntimeException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\ArrayInput;
use TYPO3\CodingStandards\Console\Application;
use TYPO3\CodingStandards\Console\Command\AbstractSetupCommand;
use TYPO3\CodingStandards\Console\Command\Command;
use TYPO3\CodingStandards\Console\Command\SetupCommand;
use TYPO3\CodingStandards\Console\Command\TypeTrait;
use TYPO3\CodingStandards\Setup;

#[\PHPUnit\Framework\Attributes\CoversClass(AbstractSetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Application::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Command::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(SetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(TypeTrait::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Setup::class)]
final class AbstractSetupCommandTest extends SetupCommandTestCase
{
private ?AbstractSetupCommandTestImplementation $setupCommandTestImplementation = null;

protected function getCommand(string $name): Command
protected function getCommand(string $name): BaseCommand
{
if (!$this->setupCommandTestImplementation instanceof AbstractSetupCommandTestImplementation) {
$this->setupCommandTestImplementation = new AbstractSetupCommandTestImplementation();
Expand Down
8 changes: 8 additions & 0 deletions tests/Unit/Console/Command/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@

use Symfony\Component\Console\Command\Command as BaseCommand;
use Symfony\Component\Console\Input\ArrayInput;
use TYPO3\CodingStandards\Console\Application;
use TYPO3\CodingStandards\Console\Command\AbstractSetupCommand;
use TYPO3\CodingStandards\Console\Command\Command;
use TYPO3\CodingStandards\Console\Command\SetupCommand;
use TYPO3\CodingStandards\Console\Command\TypeTrait;

#[\PHPUnit\Framework\Attributes\CoversClass(Command::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Application::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(AbstractSetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(SetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(TypeTrait::class)]
final class CommandTest extends CommandTestCase
{
private ?CommandTestImplementation $commandTestImplementation = null;
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Console/Command/SetupCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@

use Generator;
use RuntimeException;
use TYPO3\CodingStandards\Console\Application;
use TYPO3\CodingStandards\Console\Command\AbstractSetupCommand;
use TYPO3\CodingStandards\Console\Command\Command;
use TYPO3\CodingStandards\Console\Command\SetupCommand;
use TYPO3\CodingStandards\Setup;

#[\PHPUnit\Framework\Attributes\CoversClass(SetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Application::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(AbstractSetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Command::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Setup::class)]
final class SetupCommandTest extends SetupCommandTestCase
{
#[\PHPUnit\Framework\Attributes\DataProvider('typeDataProvider')]
Expand Down
12 changes: 12 additions & 0 deletions tests/Unit/Console/Command/UpdateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@

namespace TYPO3\CodingStandards\Tests\Unit\Console\Command;

use TYPO3\CodingStandards\Console\Application;
use TYPO3\CodingStandards\Console\Command\AbstractSetupCommand;
use TYPO3\CodingStandards\Console\Command\Command;
use TYPO3\CodingStandards\Console\Command\SetupCommand;
use TYPO3\CodingStandards\Console\Command\TypeTrait;
use TYPO3\CodingStandards\Console\Command\UpdateCommand;
use TYPO3\CodingStandards\Setup;

#[\PHPUnit\Framework\Attributes\CoversClass(UpdateCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Application::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(AbstractSetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Command::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(SetupCommand::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(TypeTrait::class)]
#[\PHPUnit\Framework\Attributes\UsesClass(Setup::class)]
final class UpdateCommandTest extends UpdateCommandTestCase
{
public function testExecute(): void
Expand Down

0 comments on commit 5fbc84b

Please sign in to comment.