I know that creating an instance of a Class
in the middle of a method
it's a bad practice since it makes code hard to test. But I can't refactor the code, so I need to find a way to mock an Object
created with new
in the middle of a method
under test.
Used Frameworks: PHPUnit
, Mockery
, WP_Mock
Aucun commentaire:
Enregistrer un commentaire