Repository navigation
Commit 391390b
tests: return a string from the mocked Parser::recursiveTagParse
MediaWiki master declares Parser::recursiveTagParse() and
recursiveTagParseFully() with a `string` return type. The component test
mocks stub them with returnArgument(0), echoing the input verbatim. When a
component passes a non-string attribute value (a bool or int) to the parser,
the mock returns that non-string and PHPUnit's typed mock throws "Return
value must be of type string".
Cast the echoed value to string so the mocks honour the method's contract.
Behaviour is unchanged for string inputs, and the renderErrorMessage mock is
left as-is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 98e3740 commit 391390b
2 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
0 commit comments