I usually use the getter and setter methods for my objects, and I'm fine with testing them as a mock of objects in SimpleTest, manipulating them with code, for example:
Mock::generate('MyObj');
$MockMyObj->setReturnValue('getPropName', 'value')
However, I recently started using magic interceptors (__set () __get ()) and gained access to the following properties:
$MyObj->propName = 'blah';
But I am having difficulty creating a mock object that has a specific property that is accessible using this technique.
So there is a special way to set properties in MockObjects.
I tried to do:
$MockMyObj->propName = 'test Value';
but this does not seem to work. Not sure if this is my Subject, Mock, magic Interceptors or SimpleTest test, which causes the property to be inaccessible.
So in short:
, . Mock Object Simpletest?
.