DEV Community

Discussion on: Setting private properties in tests

Collapse
 
vlasales profile image
Vlastimil Pospichal

How do you get the property name? It is private and may change at any time in subsequent versions.

Thread Thread
 
matthewbdaly profile image
Matthew Daly

Well, this is my own project I'm testing. If the property name does change in future either I'll know and will remember to update it in the test, or I'll forget and the tests will break in Travis CI, reminding me to fix them. Given that this is a Doctrine entity and so it expects the property in question to be called $id, that's fairly unlikely.