issue #324 - fix how composer settings are created in the GeneratorOptions class#336
Conversation
- Used internally by the class to determine if the setComposerSettings method has been called already - When set to true, this property ensures 'setComposerSettings' is not called infinitely
- the condition checks if the input contains composer settings, then calls 'setComposerSettings' if so - updating 'calledSetComposerSettings' to true before calling 'setComposerSettings' is required to prevent an infinite call chain - this fixes issue WsdlToPhp#324 where the composer settings are incorrectly written to the composer.json file
- the goal is to test writing composer settings both from the command line and from a PHP array - this is to ensure that the caller can successfully create composer settings from both the command line and from a WsdlToPHP project script
|
Thanks for you work @ajoh504 , could you add at least one test in the WsdlToPhp\PackageGenerator\Tests\File\ComposerTest to see an actual composer.json result? |
- this test also adds additional composer settings via `setOptionComposerSettings`
Hi @mikaelcom, my pleasure. I've added an additional test to I considered creating an instance of |
- Order the key/value pairs to appropriately match the expected values and actual values
|
I'm finding some failures with the PHP Unit tests for the |
Feel free to create a new issue then 😉 |
Co-authored-by: Mikaël DELSOL <contact@mikael-delsol.fr>
mikaelcom
left a comment
There was a problem hiding this comment.
let me know if you can't merge by yourself
|
It looks like I only have the option to "Close with comment." |
The
GeneratorOptions::setOptionValuemethod contains a new condtion to check if the current input contains composer settings, and internally callssetComposerSettingsif so. The unit tests attempt to test the following possibilites:This fixes issue #324 where, when adding composer settings via the command line, the composer.json file was written as this:
instead of this: