Closed Chartman123 closed 1 month ago
Attention: Patch coverage is 21.62162%
with 29 lines
in your changes missing coverage. Please review.
Please upload report for BASE (
main@b40ef76
). Learn more about missing BASE report. Report is 2 commits behind head on main.
@susnux do you have any idea why I get an Error 500 as soon as I open the Forms app?
Type: Error
Code: 0
Message: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames
File: /srv/www/htdocs/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php
Line: 104
@susnux I was able to resolve my issue (thanks to @come-nc)
This can now be reviewed. I currently needed a little hack in the ApiControllerTest to make them pass. (state
and lastUpdated
don't have the expected values in line 499. null
instead of 0
and 0
instead of 123456789
).
@Koc thanks for the approval. Do you perhaps have an idea how to fix the test in a better way? I'm no expert in tests 🙈😂
Usually it is recommended to rely on Psr\Clock\ClockInterface
instead of plain time()
and use MockClock
implementation in tests.
Another variant - you can mock native time()
by defining mocked function inside same namespace.
But I think we can live with current approach.
Yes we can leave it for now and add a to-do comment. What bothers me the most is that the time() mocking worked before but doesn't anymore. Probably because the timestamp generation is now moved from the ApiController to the FormMapper
This commit refactors the form creation and update logic in the
ApiController
class. It removes the unnecessary setting of thecreated
andlastUpdated
timestamps in theForm
entity, as these values are now automatically set in theFormMapper
class. This improves code readability and reduces redundancy.The changes also include updates to the
FormMapper
class, where theinsert
andupdate
methods now automatically set thecreated
andlastUpdated
timestamps respectively.