[make:crud] Use CamelCase for getter and setter#1775
Conversation
|
Good find, thanks for the fix. Could you also add a test case in MakeCrudTest? Also, the command that uses this template is |
|
Hi @GromNaN
I've looked around but I can't seem to find how to test that. My idea would have been to check the generated I fixed the title of the PR, and I got tests running locally. |
|
The test must validates that the generated functional test is passing. maker-bundle/tests/Maker/MakeCrudTest.php Lines 68 to 88 in 8843412 But use a different entity class that has a property name that reproduces the bug you fixed. |
|
Thanks to your input @GromNaN , I managed to create a test suite that validates this PR and will prevent the issue from re-appearing. I checked locally, if you remove the feature changed in |
4e80dec to
e1e6719
Compare
|
Thank you @tcoch. |
When creating tests, getters and setters can be wrong. This PR aims to fix that.
Bug to fix
Creation of `Foo` entity with parameter `foo_foo` - `make:entity` + `make:crud`
Test generated > end up with `setFoo_foo()` / `getFoo_foo()`
Test generated with fix
Creation of `Bar` entity with parameter `bar_bar` - `make:entity` + `make:crud`
Test generated > end up with `setBarBar()` / `getBarBar()`