diff --git a/src/Configuration/PhpUnitConfigGenerator.php b/src/Configuration/PhpUnitConfigGenerator.php index c800f0a..c6d8d2e 100644 --- a/src/Configuration/PhpUnitConfigGenerator.php +++ b/src/Configuration/PhpUnitConfigGenerator.php @@ -41,7 +41,7 @@ public function generate(ProjectContext $context): string command->callPassthrough($args); $this->assertSame($args, $result); } - - // ── Output helpers — fwrite(STDOUT/STDERR) cannot be captured by ob_start ─ - // We verify these methods exist and do not throw exceptions. - - #[Test] - public function infoDoesNotThrow(): void - { - $this->expectNotToPerformAssertions(); - $this->command->callInfo('hello'); - } - - #[Test] - public function warningDoesNotThrow(): void - { - $this->expectNotToPerformAssertions(); - $this->command->callWarning('caution'); - } - - #[Test] - public function errorDoesNotThrow(): void - { - $this->expectNotToPerformAssertions(); - $this->command->callError('something failed'); - } - - #[Test] - public function lineDoesNotThrow(): void - { - $this->expectNotToPerformAssertions(); - $this->command->callLine('some output'); - } - - #[Test] - public function bannerDoesNotThrow(): void - { - $this->expectNotToPerformAssertions(); - $this->command->callBanner('My Banner'); - } - - #[Test] - public function sectionDoesNotThrow(): void - { - $this->expectNotToPerformAssertions(); - $this->command->callSection('My Section'); - } } diff --git a/tests/Unit/Configuration/CsFixerConfigGeneratorTest.php b/tests/Unit/Configuration/CsFixerConfigGeneratorTest.php index 06e772c..8d20309 100644 --- a/tests/Unit/Configuration/CsFixerConfigGeneratorTest.php +++ b/tests/Unit/Configuration/CsFixerConfigGeneratorTest.php @@ -8,9 +8,11 @@ use KaririCode\Devkit\Core\ProjectContext; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; #[CoversClass(CsFixerConfigGenerator::class)] +#[UsesClass(ProjectContext::class)] final class CsFixerConfigGeneratorTest extends TestCase { private CsFixerConfigGenerator $generator; diff --git a/tests/Unit/Configuration/PhpStanConfigGeneratorTest.php b/tests/Unit/Configuration/PhpStanConfigGeneratorTest.php index 7fb6d3b..a3b0f91 100644 --- a/tests/Unit/Configuration/PhpStanConfigGeneratorTest.php +++ b/tests/Unit/Configuration/PhpStanConfigGeneratorTest.php @@ -8,9 +8,11 @@ use KaririCode\Devkit\Core\ProjectContext; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; #[CoversClass(PhpStanConfigGenerator::class)] +#[UsesClass(ProjectContext::class)] final class PhpStanConfigGeneratorTest extends TestCase { private PhpStanConfigGenerator $generator; diff --git a/tests/Unit/Configuration/PhpUnitConfigGeneratorTest.php b/tests/Unit/Configuration/PhpUnitConfigGeneratorTest.php index 1972a39..cb6846f 100644 --- a/tests/Unit/Configuration/PhpUnitConfigGeneratorTest.php +++ b/tests/Unit/Configuration/PhpUnitConfigGeneratorTest.php @@ -8,9 +8,11 @@ use KaririCode\Devkit\Core\ProjectContext; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; #[CoversClass(PhpUnitConfigGenerator::class)] +#[UsesClass(ProjectContext::class)] final class PhpUnitConfigGeneratorTest extends TestCase { private PhpUnitConfigGenerator $generator; diff --git a/tests/Unit/Configuration/PsalmConfigGeneratorTest.php b/tests/Unit/Configuration/PsalmConfigGeneratorTest.php index ff9b56a..2c939fe 100644 --- a/tests/Unit/Configuration/PsalmConfigGeneratorTest.php +++ b/tests/Unit/Configuration/PsalmConfigGeneratorTest.php @@ -8,9 +8,11 @@ use KaririCode\Devkit\Core\ProjectContext; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; #[CoversClass(PsalmConfigGenerator::class)] +#[UsesClass(ProjectContext::class)] final class PsalmConfigGeneratorTest extends TestCase { private PsalmConfigGenerator $generator; diff --git a/tests/Unit/Configuration/RectorConfigGeneratorTest.php b/tests/Unit/Configuration/RectorConfigGeneratorTest.php index 5fc58bd..91c4537 100644 --- a/tests/Unit/Configuration/RectorConfigGeneratorTest.php +++ b/tests/Unit/Configuration/RectorConfigGeneratorTest.php @@ -8,9 +8,11 @@ use KaririCode\Devkit\Core\ProjectContext; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; #[CoversClass(RectorConfigGenerator::class)] +#[UsesClass(ProjectContext::class)] final class RectorConfigGeneratorTest extends TestCase { private RectorConfigGenerator $generator; diff --git a/tests/Unit/Core/DevkitTest.php b/tests/Unit/Core/DevkitTest.php index 4b1ce60..67eea58 100644 --- a/tests/Unit/Core/DevkitTest.php +++ b/tests/Unit/Core/DevkitTest.php @@ -7,6 +7,7 @@ use KaririCode\Devkit\Contract\ConfigGenerator; use KaririCode\Devkit\Contract\ToolRunner; use KaririCode\Devkit\Core\Devkit; +use KaririCode\Devkit\Core\DevkitConfig; use KaririCode\Devkit\Core\ProjectContext; use KaririCode\Devkit\Core\ProjectDetector; use KaririCode\Devkit\Exception\DevkitException; @@ -19,7 +20,8 @@ #[CoversClass(Devkit::class)] #[UsesClass(ProjectContext::class)] -#[UsesClass(DevkitException::class)] +#[UsesClass(ProjectDetector::class)] +#[UsesClass(DevkitConfig::class)] #[UsesClass(QualityReport::class)] #[UsesClass(ToolResult::class)] final class DevkitTest extends TestCase diff --git a/tests/Unit/Core/ProjectDetectorTest.php b/tests/Unit/Core/ProjectDetectorTest.php index 60da41b..258fe6d 100644 --- a/tests/Unit/Core/ProjectDetectorTest.php +++ b/tests/Unit/Core/ProjectDetectorTest.php @@ -16,7 +16,6 @@ #[CoversClass(ProjectDetector::class)] #[UsesClass(ProjectContext::class)] #[UsesClass(DevkitConfig::class)] -#[UsesClass(DevkitException::class)] final class ProjectDetectorTest extends TestCase { private string $tmpDir; diff --git a/tests/Unit/Exception/ConfigurationExceptionTest.php b/tests/Unit/Exception/ConfigurationExceptionTest.php index f4340b1..05a2a5f 100644 --- a/tests/Unit/Exception/ConfigurationExceptionTest.php +++ b/tests/Unit/Exception/ConfigurationExceptionTest.php @@ -6,13 +6,11 @@ use KaririCode\Devkit\Exception\ConfigurationException; use KaririCode\Devkit\Exception\DevkitException; -use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; -use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; -#[CoversClass(ConfigurationException::class)] -#[UsesClass(DevkitException::class)] +#[CoversNothing] final class ConfigurationExceptionTest extends TestCase { #[Test] diff --git a/tests/Unit/Exception/DevkitExceptionTest.php b/tests/Unit/Exception/DevkitExceptionTest.php index b3ff102..c241d5a 100644 --- a/tests/Unit/Exception/DevkitExceptionTest.php +++ b/tests/Unit/Exception/DevkitExceptionTest.php @@ -5,11 +5,11 @@ namespace KaririCode\Devkit\Tests\Unit\Exception; use KaririCode\Devkit\Exception\DevkitException; -use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; -#[CoversClass(DevkitException::class)] +#[CoversNothing] final class DevkitExceptionTest extends TestCase { #[Test] diff --git a/tests/Unit/Exception/ToolExceptionTest.php b/tests/Unit/Exception/ToolExceptionTest.php index 418e011..6c89c6a 100644 --- a/tests/Unit/Exception/ToolExceptionTest.php +++ b/tests/Unit/Exception/ToolExceptionTest.php @@ -6,13 +6,11 @@ use KaririCode\Devkit\Exception\DevkitException; use KaririCode\Devkit\Exception\ToolException; -use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; -use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; -#[CoversClass(ToolException::class)] -#[UsesClass(DevkitException::class)] +#[CoversNothing] final class ToolExceptionTest extends TestCase { #[Test]