Skip to content

Commit 0bfbf9c

Browse files
committed
refactor: rename clearOutputOnRun to clearDebugOutputOnRun, OutputChannel to PHPUnit Debug
The OutputChannel is used for debug/raw output. Rename the setting and display name to reflect this purpose.
1 parent bf7679b commit 0bfbf9c

8 files changed

Lines changed: 15 additions & 13 deletions

File tree

packages/extension/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
2424
- Refactor: replace base64 filter encoding with placeholder approach
2525
- Refactor: rename OutputChannelObserver to RawOutputObserver, organize Writers
2626
- Refactor: strip ANSI codes in RawOutputObserver and ErrorDialogObserver
27+
- Rename: OutputChannel display name from "PHPUnit" to "PHPUnit Debug"
28+
- Rename: `clearOutputOnRun` setting to `clearDebugOutputOnRun`
2729

2830
## [3.9.25] - 2026-02-24
2931

packages/extension/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Add to `.vscode/settings.json`. All settings use the `phpunit.*` prefix.
7474
// Override individual format fields from the preset (see phpunit package docs)
7575
"phpunit.output.format": {},
7676

77-
// Clear output channel before each run (default: true)
78-
"phpunit.clearOutputOnRun": true,
77+
// Clear debug output channel before each run (default: true)
78+
"phpunit.clearDebugOutputOnRun": true,
7979

8080
// When to show output: "always" | "onFailure" | "never" (default: "onFailure")
8181
"phpunit.showAfterExecution": "onFailure",

packages/extension/README.zh-TW.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
// 覆寫預設的個別格式欄位(詳見 phpunit 套件文件)
7575
"phpunit.output.format": {},
7676

77-
// 每次執行前清除輸出頻道(預設:true)
78-
"phpunit.clearOutputOnRun": true,
77+
// 每次執行前清除除錯輸出頻道(預設:true)
78+
"phpunit.clearDebugOutputOnRun": true,
7979

8080
// 何時顯示輸出:"always" | "onFailure" | "never"(預設:"onFailure")
8181
"phpunit.showAfterExecution": "onFailure",

packages/extension/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
"description": "Override individual format fields from the preset. See documentation for available fields.",
151151
"scope": "resource"
152152
},
153-
"phpunit.clearOutputOnRun": {
153+
"phpunit.clearDebugOutputOnRun": {
154154
"type": "boolean",
155155
"default": true,
156-
"description": "True will clear the output when we run a new test. False will leave the output after every test.",
156+
"description": "Clear the debug output channel before each test run.",
157157
"scope": "resource"
158158
},
159159
"phpunit.showAfterExecution": {

packages/extension/src/Observers/RawOutputObserver.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('RawOutputObserver clear behavior', () => {
1515
const createObserver = (config: Record<string, unknown> = {}) => {
1616
const outputChannel = vscode.window.createOutputChannel('phpunit');
1717
const configuration = new Configuration({
18-
clearOutputOnRun: true,
18+
clearDebugOutputOnRun: true,
1919
...config,
2020
});
2121
const observer = new RawOutputObserver(outputChannel, configuration);
@@ -44,7 +44,7 @@ describe('RawOutputObserver clear behavior', () => {
4444

4545
it('each observer instance clears independently', () => {
4646
const outputChannel = vscode.window.createOutputChannel('phpunit');
47-
const configuration = new Configuration({ clearOutputOnRun: true });
47+
const configuration = new Configuration({ clearDebugOutputOnRun: true });
4848
const observer1 = new RawOutputObserver(outputChannel, configuration);
4949
const observer2 = new RawOutputObserver(outputChannel, configuration);
5050

@@ -68,7 +68,7 @@ describe.each(detectPhpUnitStubs())('RawOutputObserver on $name (PHPUnit $phpUni
6868
php: 'php',
6969
phpunit: binary,
7070
args: ['-c', 'phpunit.xml', ...stubArgs],
71-
clearOutputOnRun: true,
71+
clearDebugOutputOnRun: true,
7272
});
7373
testRunner = new TestRunner();
7474
const outputChannel = vscode.window.createOutputChannel('phpunit');
@@ -98,7 +98,7 @@ describe.each(detectPhpUnitStubs())('RawOutputObserver on $name (PHPUnit $phpUni
9898
}
9999

100100
it('should not clear output channel', async () => {
101-
await configuration.update('clearOutputOnRun', false);
101+
await configuration.update('clearDebugOutputOnRun', false);
102102
const testFile = phpUnitProject('tests/AssertionsTest.php');
103103
const filter = 'test_passed';
104104
await run(testFile, filter);

packages/extension/src/Observers/RawOutputObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class RawOutputObserver implements TestRunnerObserver {
2828
return;
2929
}
3030

31-
if (this.configuration.get('clearOutputOnRun') === true) {
31+
if (this.configuration.get('clearDebugOutputOnRun') === true) {
3232
this.writer.clear();
3333
}
3434

packages/extension/src/extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ describe('Extension Test', () => {
300300
);
301301

302302
expect(workspace.getConfiguration).toHaveBeenCalledWith('phpunit', expect.anything());
303-
expect(window.createOutputChannel).toHaveBeenCalledWith('PHPUnit', 'phpunit');
303+
expect(window.createOutputChannel).toHaveBeenCalledWith('PHPUnit Debug', 'phpunit');
304304
expect(tests.createTestController).toHaveBeenCalledWith('phpunit', 'PHPUnit');
305305
for (const cmd of [
306306
'phpunit.reload',

packages/extension/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function activate(context: ExtensionContext) {
3333
});
3434

3535
const ctrl = tests.createTestController('phpunit', 'PHPUnit');
36-
const outputChannel = window.createOutputChannel('PHPUnit', 'phpunit');
36+
const outputChannel = window.createOutputChannel('PHPUnit Debug', 'phpunit');
3737
const parentContainer = createParentContainer(ctrl, outputChannel);
3838
const folderManager = parentContainer.get(WorkspaceFolderManager);
3939

0 commit comments

Comments
 (0)