-
Notifications
You must be signed in to change notification settings - Fork 0
Fix test failures: register cypher_raw magic word and handle final class in tests #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| if ( $jsonOutput === false ) { | ||
| throw new RuntimeException( wfMessage( 'neowiki-cypher-raw-error-json-encode' )->text() ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked, and seems reasonable to actually check for failed json decode.
|
@copilot add an usage of this new parser function to DemoData |
Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
Updated the description of the cypher_raw parser function and clarified its demo status.
3f958af to
a643456
Compare
Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
|
Needs some more work. I call it a day, feel free to take over! |
|
There were 3 errors:
/home/runner/work/NeoWiki/NeoWiki/mediawiki/extensions/NeoWiki/tests/phpunit/EntryPoints/CypherRawParserFunctionTest.php:72
/home/runner/work/NeoWiki/NeoWiki/mediawiki/extensions/NeoWiki/tests/phpunit/EntryPoints/CypherRawParserFunctionTest.php:111
/home/runner/work/NeoWiki/NeoWiki/mediawiki/extensions/NeoWiki/tests/phpunit/EntryPoints/CypherRawParserFunctionTest.php:131 ERRORS! |
Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
Fixed in 55447ce. Replaced the anonymous class stub with PHPUnit's |
/home/runner/work/NeoWiki/NeoWiki/mediawiki/extensions/NeoWiki/tests/phpunit/EntryPoints/CypherRawParserFunctionTest.php:30 |
…lass Co-authored-by: JeroenDeDauw <146040+JeroenDeDauw@users.noreply.github.com>
Fixed in eff1f32. Changed approach to use |
|
Replaced by #471 with a clean single commit. |
Fix Test Failures Plan
Issues Identified:
Mock Issue:SummarizedResultis a final class and cannot be mocked with PHPUnitNeed to create a test stub/wrapper or use actual instancesMagic Word Issue: Parser function not registered as magic wordNeed to createi18n/_Magic.phpfileNeed to register it inextension.jsonReturn Type Issue: Anonymous class stub didn't satisfy theSummarizedResultreturn type declarationFinal Class Stubbing Issue: Even
createStub()cannot be used on final classes in PHPUnitFix Plan:
Changes Made:
i18n/_Magic.php: Defines thecypher_rawmagic word for MediaWiki parserextension.json: Registered the magic words filecreateMock()for QueryEngine interfacewillReturnCallback()to return an anonymous class that implementstoArray()SummarizedResultclass directlyOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.