Skip to content

Commit e86f018

Browse files
committed
test(cleanup): remove output noise from tests and fix phpunit schema deprecation
Remove 6 output helper tests from AbstractCommandTest that produced terminal noise (hello, ⚠ caution, ✗ something failed, My Banner, etc.). These tests call fwrite(STDOUT/STDERR) directly which bypasses PHPUnit's output buffering, making them unverifiable (assertTrue(true) only). Update phpunit.xml schema template from 11.0 to 12.5 in PhpUnitConfigGenerator so that kcode init generates configs compatible with PHPUnit 12.5, eliminating: 'Your XML configuration validates against a deprecated schema.' Result: 152 tests · ✓ Tests passed · 0 deprecations · 0 warnings · 0 risky
1 parent d840e12 commit e86f018

2 files changed

Lines changed: 1 addition & 47 deletions

File tree

src/Configuration/PhpUnitConfigGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function generate(ProjectContext $context): string
4141
<?xml version="1.0" encoding="UTF-8"?>
4242
<!-- Generated by KaririCode Devkit — override via devkit.php (project root) -->
4343
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
44+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd"
4545
bootstrap="../vendor/autoload.php"
4646
cacheDirectory="build/.phpunit.cache"
4747
executionOrder="depends,defects"

tests/Unit/Command/AbstractCommandTest.php

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -184,50 +184,4 @@ public function passthroughWithNoConsumedFlagsReturnsAll(): void
184184
$result = $this->command->callPassthrough($args);
185185
$this->assertSame($args, $result);
186186
}
187-
188-
// ── Output helpers — use assertIsString as trivial assertion ───
189-
// fwrite(STDOUT/STDERR) bypasses ob_start; we verify no exception
190-
// is thrown and perform a trivial assertion to avoid Notice.
191-
192-
#[Test]
193-
public function infoWritesToOutput(): void
194-
{
195-
$this->command->callInfo('hello');
196-
$this->assertTrue(true);
197-
}
198-
199-
#[Test]
200-
public function warningWritesToOutput(): void
201-
{
202-
$this->command->callWarning('caution');
203-
$this->assertTrue(true);
204-
}
205-
206-
#[Test]
207-
public function errorWritesToStderr(): void
208-
{
209-
$this->command->callError('something failed');
210-
$this->assertTrue(true);
211-
}
212-
213-
#[Test]
214-
public function lineWritesToOutput(): void
215-
{
216-
$this->command->callLine('some output');
217-
$this->assertTrue(true);
218-
}
219-
220-
#[Test]
221-
public function bannerWritesToOutput(): void
222-
{
223-
$this->command->callBanner('My Banner');
224-
$this->assertTrue(true);
225-
}
226-
227-
#[Test]
228-
public function sectionWritesToOutput(): void
229-
{
230-
$this->command->callSection('My Section');
231-
$this->assertTrue(true);
232-
}
233187
}

0 commit comments

Comments
 (0)