public function testObserversWillBeNotifiedOnChangeLocalPart() { $ob = new StubObserverImpl(); $this->address->attachObserver($ob); $this->address->setLocalPart('test3'); $this->assertTrue($ob->hasBeenCalled()); $this->assertEquals(Address::EVENT_CHANGE_LOCAL_PART, $ob->getLastCallType()); }
private function addInstance(AddressImpl $instance) { $this->addressList[$instance->getLocalPart()] = $instance; $instance->attachObserver($this); }