/**
  * @param ValueObject $other
  *
  * @return bool
  */
 public function sameValueAs(Username $other)
 {
     if (!$other instanceof self) {
         return false;
     }
     return $this->toString() === $other->toString();
 }
Exemple #2
0
 /** @test */
 public function should_return_as_string()
 {
     $username = new Username('philipbrown');
     $this->assertEquals('philipbrown', $username->toString());
 }
 /**
  * @param Username $other
  *
  * @return bool
  */
 public function sameValueAs(Username $other)
 {
     return $this->toString() === $other->toString();
 }