Exemplo n.º 1
0
 public function testEquals()
 {
     $compareTeam = new Team();
     $this->assertTrue($this->team->equals($compareTeam));
     $this->team->setId(1);
     $compareTeam->setId(2);
     $this->assertFalse($this->team->equals($compareTeam));
 }
Exemplo n.º 2
0
 /**
  * @param Team $team
  */
 public function setTeam(Team $team)
 {
     if (null === $this->team || !$this->team->equals($team)) {
         $this->team = $team;
         $this->team->addPlayer($this);
     }
 }