public function testAddUserIsPersistentAndUsernameUpdateOk() { $this->address->addOwner($this->owner1); $address = $this->cloneAddress($this->address); $this->owner1->setUsername("bob"); $this->assertTrue($address->isOwner($this->owner1)); }
/** * Checks if a user is a owner of the address. * @param User $owner * @return bool */ public function isOwner(User $owner) { $this->setUpOwners(); return isset($this->owners[$owner->getUsername()]); }