Skip to content

Commit 6b21dc4

Browse files
claudedeviantintegral
authored andcommitted
test: kill ReturnRemoval mutation in SplitCommand file not found check
Add assertion to verify that only the "File not found" error message appears when a non-existent file is specified. Without the return statement, execution would continue and also produce "Unable to read file" error, which this test now detects.
1 parent 6436a29 commit 6b21dc4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/src/Functional/SplitCommandTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,13 @@ public function testSplitFailsWhenFileDoesNotExist(): void
256256
// Should fail with FAILURE status
257257
$this->assertSame(Command::FAILURE, $this->commandTester->getStatusCode());
258258

259-
// Should display error message
259+
// Should display ONLY "File not found" error message
260260
$output = $this->commandTester->getDisplay();
261261
$this->assertStringContainsString('File not found', $output);
262262
$this->assertStringContainsString('nonexistent.har', $output);
263+
// Must NOT contain any other error messages (kills ReturnRemoval mutation)
264+
// Without the return, execution would continue and hit "Unable to read file"
265+
$this->assertStringNotContainsString('Unable to read file', $output);
263266
}
264267

265268
public function testSplitFailsWhenPathIsDirectory(): void

0 commit comments

Comments
 (0)