Skip to content

Commit

Permalink
Merge pull request #269 from recca0120/fix/test-id
Browse files Browse the repository at this point in the history
fix #268
  • Loading branch information
recca0120 authored Jan 22, 2025
2 parents d61fb88 + 5316bf9 commit e2b280c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 50 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "PHPUnit Test Explorer",
"icon": "img/icon.png",
"publisher": "recca0120",
"version": "3.5.16",
"version": "3.5.17",
"private": true,
"license": "MIT",
"repository": {
Expand Down
14 changes: 14 additions & 0 deletions src/PHPUnit/ProblemMatcher/PestProblemMatcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,4 +719,18 @@ describe('Pest ProblemMatcher Text', () => {
});
});
});

it('multi-word class names', () => {
resultShouldBe(`##teamcity[testStarted name='Login screen can be rendered' locationHint='pest_qn://Authentication Page (Tests\\Feature\\AuthenticationPage)::Login screen can be rendered' flowId='72545']`, {
event: TeamcityEvent.testStarted,
id: 'Authentication Page (Tests\\Feature\\AuthenticationPage)::Login screen can be rendered',
flowId: 72545,
});

resultShouldBe(`##teamcity[testFinished name='Login screen can be rendered' duration='1' flowId='72545']`, {
event: TeamcityEvent.testFinished,
id: 'Authentication Page (Tests\\Feature\\AuthenticationPage)::Login screen can be rendered',
flowId: 72545,
});
});
});
2 changes: 1 addition & 1 deletion src/PHPUnit/Transformer/PestTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class PestTransformer extends PHPUnitTransformer {
};

fromLocationHit(locationHint: string, name: string) {
const matched = locationHint.match(/(pest_qn|file):\/\/(?<id>(?<prefix>\w+)\s+\((?<classFQN>[\w\\]+)\)(::(?<method>.+))?)/);
const matched = locationHint.match(/(pest_qn|file):\/\/(?<id>(?<prefix>[\w\s]+)\((?<classFQN>[\w\\]+)\)(::(?<method>.+))?)/);
if (!matched) {
const location = PestV1Fixer.fixLocationHint(locationHint.replace(/(pest_qn|file):\/\//, '').replace(/\\/g, '/'));
const id = this.removeDataset(this.normalizeMethodName(PestV2Fixer.fixId(location, name)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
48 changes: 0 additions & 48 deletions src/PHPUnit/__tests__/fixtures/phpunit-stub/.vscode/launch.json

This file was deleted.

0 comments on commit e2b280c

Please sign in to comment.