Skip to content

Commit 5886fd3

Browse files
claudedeviantintegral
authored andcommitted
test: kill MethodCallRemoval mutations for progress bar methods
Strengthen progress bar test assertions to verify: - 100% completion is shown (kills progressFinish removal mutation) - Intermediate progress states exist (kills progressAdvance removal mutation)
1 parent 6b21dc4 commit 5886fd3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/src/Functional/SplitCommandTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,20 +337,22 @@ public function testSplitUpdatesProgressBar(): void
337337

338338
$output = $this->commandTester->getDisplay();
339339

340-
// Verify progress messages are shown
341-
// The progress bar shows "11/11" when complete
340+
// Verify progress bar completes (progressFinish mutation killer)
341+
// The progress bar shows "11/11" and "100%" when progressFinish is called
342342
$this->assertMatchesRegularExpression('/11\/11/', $output, 'Progress should show 11/11 completion');
343+
$this->assertStringContainsString('100%', $output, 'Progress should show 100% completion');
343344

344-
// Verify the command succeeds (which confirms progressFinish was called)
345+
// Verify intermediate progress is shown (progressAdvance mutation killer)
346+
// Without progressAdvance(), we'd only see 0/11 then jump to 11/11
347+
// Check for at least one intermediate state (anything from 1/11 to 10/11)
348+
$this->assertMatchesRegularExpression('/[1-9]\/11|10\/11/', $output, 'Progress should show intermediate states');
349+
350+
// Verify the command succeeds
345351
$this->assertSame(Command::SUCCESS, $this->commandTester->getStatusCode());
346352

347-
// Count the actual files created to confirm progress was tracked correctly
353+
// Count the actual files created
348354
$files = glob($this->tempDir.'/*.har');
349355
$this->assertCount(11, $files, 'Should create 11 files');
350-
351-
// This test kills the MethodCallRemoval mutants for:
352-
// - $io->progressAdvance() - without it, progress wouldn't reach 11/11
353-
// - $io->progressFinish() - without it, the progress bar wouldn't complete properly
354356
}
355357

356358
private function recursiveRemoveDirectory(string $directory): void

0 commit comments

Comments
 (0)