public function Test_of_addObserver2() { $ObservedPerson = new ObservedPerson(); $ObeserversReference =& $ObservedPerson->getObservers(); $this->assertEqual(strtolower(get_class($ObeserversReference[0])), 'observedpersonobserver'); $this->assertEqual($ObeserversReference[0]->message, 'Hello. I come from the past'); $this->assertEqual(strtolower(get_class($ObeserversReference[1])), 'testauditor'); $ObservedAccount = new ObservedAccount(); $ObeserversReference =& $ObservedAccount->getObservers(); $this->assertEqual(strtolower(get_class($ObeserversReference[0])), 'testauditor'); }
function Test_of__instantiateDefaultObserver() { $Observed = new ObservedPerson(); $ObeserversReference =& $Observed->getObservers(); $this->assertEqual(strtolower(get_class($ObeserversReference[0])), 'observedpersonobserver'); }