I'm in a bit of a bind.
We have some PHP production code written by a developer that needs to be refactored. However, it has zero tests. So, I'm afraid to refactor it.
I have been writing unit tests but a lot of the code depends on $_GET params when it should be using the Request class (it was built in Lumen).
So, running unit tests is impossible.
What are my options here? I could edit the code so that $_GET is no longer used but the way the code is structure, it's very risky to do that.
The funny thing is, we want to write tests so that we can refactor, but it seems that in order to be able to write tests, I have to do some refactoring anyway.
Any ideas would be appreciated.
Aucun commentaire:
Enregistrer un commentaire